0 votes

In the context of 2d games with godot I’ve Been unable to understand what global position is?
And how it relates to position ?
( my early attempts at coordinate comparisons between node2d sub-classes was pretty confusing )
And I haven’t found anything in the docs to help
Could someone tell me what global position is and how it relates to position ?

in Engine by (16 points)

2 Answers

0 votes

global position can grab the mouse position even outside the game frame.

by (21 points)
0 votes

On the 2d screen you will see perpendicular 2 lines, Y as green and X as red. Where they cross is the point (0,0), the .global_position is relative to this point, independent in what scene they are or who they are children. .position is relative to the parent, if you move the parent, the child moves too

by (106 points)
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.