• Godot Help
  • Separate rendering and transform for 2D in godot 4.4

Hello everyone! Is there any way to apply a transformation component (position, scale, rotation etc.) of one node, and rendering component (visibility, draw order in the scene tree) of another?
Like, if I need an overlay for some game object, I want it to be positioned relative to that object, but rendered somewhere outside that object's subtree.
I am coming from pixi.js, in its terms i want something like pixi-layers, or overriding updateTransform method.
How is this usually solved? Only adding overlay node as a child to "render" node and translating positions from the "transform" node comes to mind right now, but I’m not sure how to handle scale or rotation translation between different trees.

  • xyz replied to this.

    tirnous You can set CanvasItem::top_level flag to nullify node's inherited transforms, or use RemoteTransform2D node to pass transforms between nodes in different parts of the tree.

      xyz Thank you, the second one, with RemoteTransform2D worked splendidly!