[Solved] How do I maintain camera limits so it can't exceed screen edges

How do I…
I want to manitian camera limits, i see lot of videos for this feature but now it is not existed more

What is the expected result
it shouldn’t exceed screen edges when follow the player and center view of him (like every 2d game we playing)

The enforce action still exists. This is my simple event that follows my player character and enforces boundaries around my play area. I follow based on his centre point, but you could also just use a simpler ‘set to player.x()’ if you prefer. If you want to also follow the player on Y, you need a ‘Change the Y position of camera’ action too.

image

Thanks for answering, I have been trying with boundaries but I don’t work correct with me
Here is the total scene:

@worriedpixels
and this is the events:

and here is the result:


the screen goes beyond the background

  • I’m using Smooth platformer camera behavior to follow the player

Actions in an At the beginning of the scene event only happen once, right at the start, but your camera event needs to run constantly (updating every frame). Try two events:

1 Like

These are the events I use to enforce the camera they may work for you.

You just need to change the resolution to your game size

You won’t need an action to centre the camera on every frame because you’re using the smooth camera behaviour. It takes care of that for you.

1 Like

Thank you man, it is working now … I’m really grateful for you help :handshake:

1 Like

Thank you for your help :handshake: