Search Unity

Opposite of Camera Follow

Discussion in 'Scripting' started by gregmax17, Jul 15, 2018.

  1. gregmax17

    gregmax17

    Joined:
    Jan 23, 2011
    Posts:
    186
    I know there are a handful of scripts and tutorials out there about a camera following a player or target, but I want to do something the opposite.

    I want my camera to lead the player/target depending on its velocity. So if the player is moving really fast, the camera will stay in front of the player further, compared to if the player was idle. Hopefully this makes sense.

    Can someone point me to an example or write a small script, even pseudo code, it will be really helpful. Thanks!
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    It's the same thing, just put the camera in front of the player, simplest way is to parent the camera at the right position