How can I stop the camera from passing through the water?
How can I stop the camera from passing through the water?
Comment
Answer by Sotocodes · Nov 10, 2021 at 02:36 PM
A couple of simple ways: Add a collider to your camera and set the physics settings so it only collides with water and anything else you want the camera to not go through.
If you camera movement breaks collision for the above method then:
Simply detect the collision as a trigger, if it triggers with the water, manually set the cameras y position to be just above the water you are triggering.
Hope it helps :)