get_global_position() return wrong value

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bogdan
:warning: Old Version Published before Godot 3 was released.

Hello,

sometimes engine returns wrong global position on RigidBody2D. For example in this case, I am calculating distance between ball and level center, and it returns some magic numbers…

enter image description here
enter image description here

It’s not posible that ball position would be [92; 1062] my window (viewport) is 1280x800. Any ideas what is causing this and how to fix it?

Your camera must be zoomed out (and the world probably should be either Node or Node2D if you’re going to add ball as it’s child)

mateusak | 2017-01-24 00:54