Page 1 of 1

Why is my character shaking?

Posted: Tue Dec 26, 2023 8:35 pm
by MaxGamz
Game.love
(861.36 KiB) Downloaded 64 times
I first though the issue might have been my camera but I realized that it was just with the rocket itself. I am using bump.lua; however, anytime I move the player (the rocket) it shakes. I have never experienced this before and I am honestly confused on how I should go about solving the problem. I checked the code and everything seems fine, I just want smooth movement with some motion blur rather than a choppy shaky movement animation.

Re: Why is my character shaking?

Posted: Wed Dec 27, 2023 2:37 pm
by _JM_
I resolve the shake problem changing your code from this:

Code: Select all

cam:update(dt)
cam:follow(Player.x, Player.y)
to this:

Code: Select all

cam:follow(Player.x, Player.y)
cam:update(dt)
the 'follow' function from STALKER-X need to be called before the 'update' apparently...

Re: Why is my character shaking?

Posted: Wed Dec 27, 2023 7:49 pm
by MaxGamz
_JM_ wrote: Wed Dec 27, 2023 2:37 pm I resolve the shake problem changing your code from this:

Code: Select all

cam:update(dt)
cam:follow(Player.x, Player.y)
to this:

Code: Select all

cam:follow(Player.x, Player.y)
cam:update(dt)
the 'follow' function from STALKER-X need to be called before the 'update' apparently...
Thanks for the advice! So it wasn't a problem with physics, I just needed the camera to follow the layers position right?