0 votes

For example, I have a node at position (0, 0) in the WORLD, while I have a camera that causes the node to be drawn in the middle of the screen [suppose the middle of the screen is (500, 300)]. What I want is to get exactly the position where the node is drawn on the screen!

in Engine by (695 points)

1 Answer

–2 votes

2d position on screen:

camera.unproject_position(node.global_tranform.origin)

position in camera Coordinate space in 2d space or 3d space:

camera.transform.inv_xform(node. gloabl_transform.origin)
by (204 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 Frequently asked questions and 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 [email protected] with your username.