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 (40 points)

1 Answer

+2 votes
Best answer

You're looking for child.global_position I think...

answered Apr 25 by jgodfrey (5,540 points)
selected Apr 25 by Michael Aganier

Thanks! Exactly what I was looking for.

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.