How to get the position of a node relative to the camera?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By JulioYagami

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!

:bust_in_silhouette: Reply From: ATom 1

2d position on screen:


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

camera.transform.inv_xform(node. gloabl_transform.origin)