-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Snap 2D to Pixel #445
Comments
It seems like it's specifically the last part of the setup that is the cause of the issue, i.e. Not entirely sure what is needed to support it, but there is likely a way. |
Investigating a bit further, there appears to be some general challenges with the Out of curiosity, does disabling |
It still happens with both disabled: 2025-01-12.23-24-37.mp4 |
That's strange. Your setup sounds identical to all the example scenes. |
I matched all of the PhantomCamera2D settings and even tried |
Does the example scenes within the addon directory themselves run fine for you, or do they stutter as well? Also, would you be able to share a small sample project / MRP? Can run some tests locally to see what's up. |
With snap turned off, you might have to move back and forth a little to see it happen. Almost feels as though there's a floating point discrepancy? |
Running some quick checks, it appears not to be due to the My guess is that it has something to with the character itself not moving in exact pixels, bur rather floats, which would suggest that the camera is getting confused as to which pixel it should snap to. When I hardcode the position of the character by rounding its value, it does make the stutter go away: # Rest of the _phyiscs_process code
move_and_slide()
position.x = round(position.x)
position.y = round(position.y)
handle_last_collision()
print(velocity.x)
It's a hacky way of getting around it, but my guess is that the |
Not quite. My guess is that either the Snap 2D Transform/Vertices to Pixel is being ignored by it, or that method just works differently and doesn't, at least by default, move in whole pixels. Recorded an example below to show what the position of the sprite is when the rounding is disabled / enabled; both with Snap 2D enabled in Project Settings. pixel-movement.mp4 |
Issue description
I have target set to the player sprite,
move_and_slide()
is inphysics_process()
,stretch set toviewport
, physics interpolation turned on, snap to pixel turn on in PhantomCamera2D, snap 2d pixels and vertices to pixel turned on:2025-01-10.11-45-11.mp4
Even with turning some of these off, it still stutters.
Steps to reproduce
move_and_slide()
is inphysics_process()
viewport
(Optional) Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: