How do i fix my camera?

I’m making a topdown rpg style game and i want my camera to follow my player. however, it isn’t synchronize with my player movement speed, so the player always go offscreen. any idea how to fix this?

It shouldn’t be possible for your player character to go offscreen unless you’re not linking your camera to your player sprite.

Can you show your camera events?

Didn’t you use the center the camera on event?

I’m using two sprites in a object group, and i did link the camera to the player sprite. The camera move with the player, but not at the same speed. The player keeps moving offscreen

Yes I did, and that’s how I got the problem

show me your events than

cam

MC = player sprite

I did this two time cause I’m not sure if the method could use two layers

It looks like you’re only centering the camera at the beginning of the screen. That is likely the issue since “At the beginning of the scene” is only for 1 frame.

The camera needs to be centered every frame. Remove that condition.

1 Like

Ok, I think I solve the problem.

Apparently, I had this condition where if I press the left key, the player sprite would change, facing left. Same when pressing the right. I temporary disable this condition and the camera seem to work.

I’m not sure why it’s like that, but now I’m gonna have a new way to change the movement animation.