[SOLVED] How do I fix this? "center the camera on"

I have a game in development that uses a camera based on an obj_camera, that every time the player touches it, the screen changes the size I need. It works well, however, whenever I start a new stage, it shows a large part of the empty stage behind the player. How to fix this?

You need to add Camera limit there is an specific action to do that.
Look here or here

But I added, see my image! What happens is that the limit is not working, always behind the character is showing, see the green line, behind it there should be nothing on the screen!

Edit:
I caused the character’s zoom to change with each map size, and it worked!
03

Just to clarify: Your original green bar seems to only exist on the left side, and is smaller than your game resolution. Your camera cannot center on an area smaller than the game resolution. Is there more to that object?

Separately, are your character and object on the same layer? Collision doesn’t work between layers, so it may just never be triggering.

You can see how I’ve done this method here: GDevelop Metroidvania Camera Example by Silver-Streak

1 Like