• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Shaking sprite when camera is not following

R

Raff

Guest
Hello,

When i move my player sprite and the camera is not following it, the image of the player is shaking while it moves, but when the camera follows the player, the image of the player don't shake but the backgrounds are shaking. Is this normal in game maker, or am i doing something wrong ?
 

TsukaYuriko

☄️
Forum Staff
Moderator
You probably just don't see it shaking... because the camera follows it, centering the shaking thing in your field of view. This is normal in any game engine, at least when you set up your camera to instantly follow something. ;)
 
R

Raff

Guest
But i played a lot of 2d games with no shaking. And i have a camera control to follow a point that moves a little slower than the player to prevent background shaking when player stop moving, but the player shakes anyway when camera is not following it. For example, in Hollow Knight ( or any other 2d game i played even in the Super Nintendo years) there is not that shake effect. Can't i prevent it in Game Maker ?
 

Nidoking

Member
This clearly means the coordinates of your player, or the sprite, are moving rapidly. Make it not do that. One thing to check is the size, shape, and origin of all of the sprites.
 

TsukaYuriko

☄️
Forum Staff
Moderator
Oh. I figured that the shaking is intentional (such as from a hit stun effect) and the camera following made it invisible to the observer. Seems like I completely misunderstood the question. Disregard what I said before.

Could you provide a visual demonstration such as a gif or a video to establish exactly what the subject is?
 

TheouAegis

Member
By the sounds of it, the camera or player is moving at subpixel speeds. Or the camera has a speed set that doesn't ever get set to 0.
 
R

Raff

Guest
This clearly means the coordinates of your player, or the sprite, are moving rapidly. Make it not do that. One thing to check is the size, shape, and origin of all of the sprites.
Ok, i will have a look.

Oh. I figured that the shaking is intentional (such as from a hit stun effect) and the camera following made it invisible to the observer. Seems like I completely misunderstood the question. Disregard what I said before.

Could you provide a visual demonstration such as a gif or a video to establish exactly what the subject is?
No prob, thanks anyway for the answer, i will try to make a video if i learn how to make a gameplay video, i never made one.

By the sounds of it, the camera or player is moving at subpixel speeds. Or the camera has a speed set that doesn't ever get set to 0.
Ok, i will look at it.


Don't mentioned but, when the player is not moving at all, neither the player nor the background are shaking. It's only when the player is moving.
Thanks everybody !!!
 

xS89Deepx

Member
this is what i use...camera follow player.

Create Event-
camx = camera_get_view_x(view_camera[0]);
camy = camera_get_view_y(view_camera[0]);

Step Event -
camw = camera_get_view_width(view_camera[0]);
camh = camera_get_view_height(view_camera[0]);
camx += ((x - (camw/2) - camx) * 0.5)
camy += ((y - (camh/2) - camy) * 0.5)
camera_set_view_pos(view_camera[0], clamp(camx,0,room_width - camw), clamp(camy,0,room_height - camh));
 
R

Raff

Guest
Ok, flooring works very well in combination with the cam code, thankyou. The shaking problem is still there. May be its normal. don't know, but my sprite coordinates are ok and don't have subpixel move or something like that, so, it have to be ok. But i don't see this shaking in other games.
 

NightFrost

Member
What exactly do you mean with shakiness? Does the character (when camera is not following) jump in unexpected directions? Or does it seem to have something akin to quick shivers? A video capture would be a good visual aid here.
 

TsukaYuriko

☄️
Forum Staff
Moderator
Use screen recording software of your choice, upload the resulting video to YouTube and post the link, or record a GIF via ScreenToGif, upload it to an image host of your choice and post the link.
 
R

Raff

Guest
Ok, you will see when the camera is not moving and the player moves, the player is shaking and when the camera follows the player and the player is moving then the player image is clear. The same with the background, when the camera follows the player, the background is not clear and when the camera is static, then the background image is clear not shaking :


Sorry for the quality, it's done with my phone.
 
Top