The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

0 votes

I have a 2d Node called player and a child 2d node called Playername so when the player rotate the Playername rotate so i don't want the Playername to rotate i just want the Player to rotate not the Playername i tried using setastoplevel(true) but it locks the position of the node and the rotation of the node so

Playername.lock_rotation(true) is there function like that?

in Engine by (37 points)

1 Answer

0 votes

One way to do this is via a RemoteTransform2D node. To set it up...

  • Add a RemoteTransform2D node to the scene and make it a child of the parent node in question
  • Move the existing child node to be a sibling of the parent (or somewhere outside of the parent's tree).
  • On the RemoteTransform2D node, assign your original child node as the Remote Path property.
  • On the RemoteTransform2D node, in the Update section of the inspector, turn on the transform components you want to transfer between the nodes. In your case, that'd be Position (and maybe Scale).
by (22,674 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.