3
$\begingroup$

There is a way to make an object parented to another object, but only for the rotations, not for the location.

If i move the parent, the child may dont move.

If i rotate the parent, the child must rotate exactly same than the parent.

All this must work in real time in the BGE.

$\endgroup$
0
$\begingroup$

This method is not exactly what i looking for, but it do his work:

import bge


def main():

    cont = bge.logic.getCurrentController()
    own = cont.owner
    scene = bge.logic.getCurrentScene()

    rot = scene.objects ["Rotation"]

    own.worldOrientation = rot.worldOrientation

This script get the rotation from Object "rot" an set it to "own".

Location doesnt affect "own".

You can also replace this line:

own.worldOrientation = rot.worldOrientation

With this:

own.worldPosition = rot.worldPosition

for doing the same, but with the Location.

Both two works in real time in the BGE.

$\endgroup$
  • $\begingroup$ based on the script that you would have to change to be what you are looking for, to be more precise in what you want, you can put an image to know what are you using it? $\endgroup$ – user62213 Sep 19 '18 at 15:37
0
$\begingroup$

You could use the ChildOf constraint. Just add a ChildOf constraint, under the Object Constraint panel, to the child and set the target to the parent, and then uncheck all of the boxes except rotation. The child will rotate on its own axis, not the parents.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.