How can I get a child node's position?

EquiteEquite Posts: 3Member

I'm making a platforming game, and the way I set it up my RigidBody2D needs to be set to one of it's child's position for collision to work. How can I do this?

Tags :


  • EquiteEquite Posts: 3Member

    The picture I show above does not work.

    Signed Equite. Not Anyone Else

  • EquiteEquite Posts: 3Member

    Sorry I accidently typed the Visual Scripting tag in. :p

  • wombatstampedewombatstampede Posts: 41Member

    I don't see where "child" is initialized.

    You're initializing the position once when the RigidBodyInstance is created. At that time it is not sure (but unlikely) that the child node already exists.

    You should query the childs position in the _fixed_process right before you set it.

    Aside from that I don't see the sense in it. If you set the parents position then this will usually move the child as well resulting in a kind of feedback loop.

Sign In or Register to comment.