Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Vincent William Rodr |
Hi, I’m trying to follow the formula for zooming towards a point here https://forum.godotengine.org/25983/camera2d-zoom-position-towards-the-mouse but instead of the mouse, it’s the center point between two drags.
The formula (similar to the link’s formula) is this:
position -= (to_local(center_point) - window/2) / (3/4) * (resd)
The reason for why i used to_local is because the center_point is in global position.
But after printing to_local(center_point), the result is this
(-1.#IND, -1.#IND)
Why did this happen? The Script is attached to a Camera2D and the version is Godot v3.2.2 anyways