ramokz / phantom-camera

👻🎥 Control the movement and dynamically tween 2D & 3D cameras. Built for Godot 4. Inspired by Cinemachine.
https://phantom-camera.dev/
MIT License
2.17k stars 71 forks source link

Fix incorrect return type cast #269

Closed audeck closed 5 months ago

audeck commented 5 months ago

Currently, _set_limit_clamp_position() returns a Vector2i when a limit target is applied, resulting in target_position always being truncated to an integer. This, without any follow_damping, results in the truncated target_position propagating to the camera's global_position on line 577, possibly causing misalignment between the camera and the node it's following, which can be at float x and y values.

This pr simply changes the return type to Vector2, leaving any logic intact.

ramokz commented 5 months ago

Thanks for spotting and updating this :sparkles: