Stop Camera Following Player When Descending

Hello, I’m faily new to Unity3D and this is my first Project. My project is based on Doodle Jump but themed as a space game. I was wondering if anyone could shed some light on my current situation…

I’m having trouble getting the camera to stop following the player object once gravity kicks in (Player speed is based on collison with Objects and Gravity kicks in if you do not hit the objects).

I have a simple GameOver script that runs when the player position is lower than a certain camera height…but since the camera is fixed to the player constantly…i can’t get the script to work.

Any ideas?

Not sure if I really understood your question, but if you want to kill the player based on falling you could:

  1. Have some absolute height kill the player, like

    if (Player.transform.y < -100) Die();

  2. Have an invisible and huge collision object below and kill the player when she hits it.

You could also consider having the player just die when his speed is below/above some value, like

if (rigidbody.velocity.y < 0) Die();

If your issue is with the camera, you can change your follow script to check the camera’s height and stop moving accordingly, like

if (transform.y < -100) ... // stop following

Anyhow, good luck.