Tijs
1
Hi all
im working on a 2d vertical platformer for a study project.
With this simple code i control the camera
transform.position.y = player.transform.position.y
Now i only want the camera to go up, so i can put a collider under the camera that kills the player.
How can i prevent the camera from goin down the y axis?
Tijs
2
if the heigt of the target exceeds the height of the camera the camera will follow. This worked perfectly, thanks alot!
var target:Transform;
function Update ()
{
if(target.transform.position.y > Camera.main.transform.position.y)
{
Camera.main.transform.position.y = target.transform.position.y;
}
}