+1 vote

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?

in Engine by (43 points)

1 Answer

+4 votes
Best answer

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

by (12,473 points)
selected by

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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.