I am making a game somewhat similar to doodle jump where I want the player to be able to stay below the center of the camera without it moving, but if the player goes above that point the camera moves up with him and the rests when he starts falling again. Does anybody know how to do this? I have no idea where to start…
Pseudo code
if(player.transform.position.y > mainCamera.transform.position.y){
// Move camera up
}