njBrown4357
Member
Hi all,
I'm currently working on a 2D game with a smooth moving camera that follows the player. The camera itself works fine and using clamp() I've managed to keep it only moving within the confines of the room it's placed in. I want to be able to control where the camera goes more precisely, though. I thought that in theory, I could have an object act as a "wall" that stops the camera from moving when it presses up against it, so for example:
I'm currently working on a 2D game with a smooth moving camera that follows the player. The camera itself works fine and using clamp() I've managed to keep it only moving within the confines of the room it's placed in. I want to be able to control where the camera goes more precisely, though. I thought that in theory, I could have an object act as a "wall" that stops the camera from moving when it presses up against it, so for example:
- If the top border of the camera hits this object while the player jumps, the camera should not go any higher.
- If the bottom border hits it while the player falls, it should go no lower.
- And repeat this logic for the left and right borders, but on the X-axis.