[Solved] Camera moves to player when I run preview instead of starting on him

When I run a preview of my platformer the camera travels to the player character and settles on him. How do I make the camera focus on the player character from the start, so you don’t see the camera moving to him first?

I’m using the smooth camera extension, but this also happens when I use actions instead:

Both methods work exactly as I want them to once the camera has done it’s initial movement to the player character.

I found a way of forcing it to work in the way I wanted it to while experimenting with an older prototype, but I’m not sure it’s the best way to do it (image below). I already have camera boundaries in my newer prototype to stop the camera at the edges of my artwork. Would multiple boundaries clash with each other?

I didn’t notice this behaviour before because the player character starts at the far left, where camera boundaries are set. Nothing scrolls until he moves far enough right for the camera to begin following him. Just what I want. But if he is in the middle of the scene, away from the edges, when a preview is run, the camera moves to him from another (arbitrary?) location before it sticks to him.

Thank you.

If your character is starting at a different position then the center of the starting point of the camera (e.g. 960,540 on a 1080p game), then the events are doing exactly what you are telling them to. They are starting from their current position and moving over to where the player currently is.

What I would do is have a separate event at the top of the event sheet that has the “at the beginning of the scene” condition, and center the camera on the players position (no lerp expression).

That will have it start centered where the player is on the first frame, then your other event will keep it following with your delay you have set up.

1 Like

Thank you @Silver-Streak. That’s exactly what I needed.

1 Like