Smooth Camera behaviour with boundries

Sorry if this question has been answered before, I tried my best to research it but I don’t think I found an answer that works with this behaviour specifically.

I used the “Smooth Camera” extension that allows the camera to follow the player only on the x axis, however I would like to add a boundary so that the camera wouldn’t go past the map so the person playing wouldn’t see the emptiness. Here’s a picture that explains it better (ignore the horrible art):

In the picture, I don’t want the camera to go past the red border but follow the camera towards the right, basically how Undertale does it.

This is how I do it.

image

Use Enforce camera boundaries. I use absolute values (0, 0, 4220, 1080) to suit my scene size, but you could do it based on objects like your red border. The official GDevelop platformer example does it that way:

image

1 Like

This worked perfectly, thanks!

1 Like