How the f*** remote transform 2d work lol

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

I’m losing my mind to remote transform 2d. I honestly didn’t understand this node, I just use it mindlessly, can anyone explain to me what is it’s function etc.?

:bust_in_silhouette: Reply From: MrEliptik

I’ll try to explain it to you. The RemoteTransform2D will push its transform to the node you set in its property remote_path. Also note that in the update menu, you can choose which transform are pushed to the remote node. By default, position, rotation and scale will be pushed.

Let’s say you want to follow the position of NodeA but not its rotation. If you set NodeB as a child of NodeA, you’ll inherit all of its transforms, so position, rotation and scale.

What you want to do, is to make RemoteTransform2D the child of NodeA and set the remote_path to be NodeB. Under update, you would disable rotation. Of course, NodeB should not be a child of NodeA, but a sibling.
That way, the RemoteTransform2D will send its position to NodeB, which is inherited by NodeA, but won’t send its rotation.

The final structure would be something like this:

    |__ NodeA
        |__ RemoteTransform2D
    |__ NodeB

I hope this is clear, let me know if you have any question.