Camera Shift From Player to other Object with no jittering

Okay this might be kind of complicated. So I’ll be as clear as I can be.

Right now, I’m having the camera center on a player on normal play. I like it and I’m content with it. I just use the ‘Center the camera on Player’ action to make it work.

I’m noticing a big snag though. For a cut scene, I want the camera to shift from the Player, to a second character, in a smooth fashion. But, ‘Center the camera on Player’ really does center it in the very middle of the image file.

However, when I try to spawn a second object to become the new camera- it doesn’t spawn dead center, it spawns in the corner, like this.

Which means the switch from ‘Center the camera on Player’ to focusing on the ‘Camera 1’ object is still jerky visuals to the player.

A lot of this is definitely guesswork, as programming my game tends to be, but I’m stumped. I’m wondering if anyone has an easy camera solution that I’m just not thinking of. Some sort of way to pan from Player to the new Object without making the player feel like they just blinked against their will.

PS. I tried to have ‘Camera 1’ just. Sit on the character the whole time, and have my player camera follow that instead, but that made the screen VERY jittery and hard to look at, so centering the camera directly on the Player seems to be the best choice for normal, non cut scene gameplay.

Try Player.PointX(“Center”) instead of Player.X(). Similarly for Y.

Player.X is the origin, which defaults to the top left. The center is the exactly what it says.

Just to chime in here, keeping Player.Y is probably fine just because the origin point is at the correct height. Whereas the center Y point will be the player’s gut.

Thanks a bunch you guys! I knew it must have been something simple. I’ll test both to be sure!!

As always, seriously thank you guys, my game couldn’t be along this far without all the help people in this forum have given me!

1 Like

Alright! Update. The thing that seemed to work out best, was centering it via both X and Y, like this:

I made sure the camera switched to Camera 1 later then this.

And this is the example of how it turned out:


The jitteryness is almost gone (I can fix up other visuals later) and I suspect this might have to do with the collision mask.

She is 240 pixels in height, and to make it feel like she was walking on grass, the collision mask is just a little higher up on her feet. That is my best assumption for why there’s still a slight twitch when the camera shifts from player to Camera 1.

I attempted to write code something like: Player.X(“Center”+5) or something, which. Yeah, I didn’t expect it to work, but I was stumped again, trying to figure out the best way to go about it.

Since you’re using points, the collision mask should not matter at all.

I’m not seeing any jitter at all. I’m seeing it follow the position you set (setting the camera’s origin position to the center point of your player) then moving.

What happens when you set the scene variable CamerMove to 2? Is there another event that address that?