• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

GMS 2 Camera Follow Player, Sprites are Shaking/Vibrating. Rounding x and y only causes direction/motion problems.

I am trying to make a simple boat object with a camera that is following the player from the top/behind. Basically when you turn your boat, it stays right in the middle of the screen, and the world is what appears to be moving because the camera is following the player as well as rotating along with it. So the player ship should not be moving what so ever in the middle of the screen.

However when I move the ship and especially when it is turned diagonal in the world, it shakes/vibrates like crazy. I read in a few places it can be caused by subpixel movement, and that I should round/ceil the x y coordinates. I have tried this, but it causes my boat object to completely bug out with movement and direction. It does fix the shaking problem, but the boat does not even move the direction it is facing any more. I am baffled as to why rounding off x y in the end step event would completely mess up direction and motion. Any help is appreciated. I am only using direction/image angle and speed for controlling the boat.

Here is the code for the camera object. End step event:

//Turn the camera to be the same angle as the player object
camera_set_view_angle(view_camera[0],-following.image_angle + 90);

//Move along with player object
x = following.x;
y = following.y;

//round off x and y subpixel movement
x = ceil(x)
y = ceil(y)
 
Top