Make the edge of the frame the limit

Hi, everyone!

So, I have it so the camera always follows the player on its X axis, and this works fine but when I go to one of the far edges I can see off the edge into the out-of-bounds void. I was wondering if I could either limit the game’s area so it’s not as big as it is, or if there’s a way to make it so when the player gets close to the edge it stops scrolling the camera on the players X axis.

What I usually do to handle the camera is that I create a special camera sprite (invisible) and always center the camera on it. Then I move it towards the player with forces and use camera specific collisions to prevent it from showing things I don’t want players to see.

Other than arthuro’s suggestion, there is also “Center camera within limits” event. If your left edge is -500 then you can input it in that event