How to change parent node rotation without affecting the child node rotation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By User5080

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 set_as_toplevel(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?

:bust_in_silhouette: Reply From: jgodfrey

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).