I want the camera to follow the player, but I want to make it that when the edge of the bounding box is in contact with an object, the camera will not move ant further.
You have event to follow player with camera
Add to it condition
Camera X is higher than your object X
Or do it for Y
Or do it lower than
Or mix it as you want
Or use one of these
I would use a hidden sprite that covers the screen exactly. The actions I’d then take are
- Store the co-ordinates of the camera
- Move the camera
- Check for collision between screen covering sprite and object(s)
- Move camera to old co-ordinates if there is a collision detected in step 3
So I make an event where if the top border of the camera is touching the bottem border of the object, and the center of the player is greater than the center of the screen, the camera can no longer move on the Y axis.
let me test that out.