0 votes

If I have a parent Node2D with transform's translation at (50, 0) and a child Node2D with transform's translation at (100, 0).

When I type parent.position, I get (50,0).
When I type child.position, I get (100,0).

These are their respective node's relative position, but not the absolute position in the world. The child's absolute position is its relative position added to the parent's relative position: (50,0) + (100,0) = (150, 0)

How do I get the absolute position of a node?

asked Apr 25 in Engine by Michael Aganier (41 points)

by using child.global_position or parent.global_position

Please log in or register to answer this question.

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 How to use this Q&A? before posting your first questions.