-
-
Notifications
You must be signed in to change notification settings - Fork 108
Description
Issue description
I've been playing around with 2D phantom cameras recently (great initiative, btw!) and ran into weird behavior. Using lawnjelly/smoothing-addon
, simple cameras with no limit work as expected.
However, once I set a limit target (and, quickly looking through the code, I imagine the same thing happens when limit sides are set), the camera's global_position
kept getting rounded down to integer values, causing visual jitter while following a node with a position that wasn't rounded to integers.
After dissecting phantom_camera_2d.gd
, it seems the _set_limit_clamp_position
function, called from _process
through _interpolate_position
on every frame here returns a Vector2i
, resulting in the aforementioned rounding down. After changing the return type to Vector2
, everything works as expected.
As someone with little to no experience using this plugin, I don't whether:
- I'm doing something wrong and the
_set_limit_clamp_function
is getting called incorrectly every frame (and otherwise works as expected), or - the return type is indeed wrong.
That is mainly why I'm creating an issue, rather than submitting a PR (the single-commit PR would also change literally one (1) character). Thank you.
Steps to reproduce
- Create a node that is able to move at non-integer increments (a player character, etc.)
- Setup a basic
Camera2D
(no smoothing, etc.) w/ aPhantomCameraHost
- Add a
PhantomCamera2D
following said node on simple mode - Set any limits to said
PhantomCamera2D
(Optional) Minimal reproduction project
No response