Search Unity

3rd Person Platform Tutorial Camera Set Up

Discussion in 'Scripting' started by antisymmetry, Sep 1, 2009.

  1. antisymmetry

    antisymmetry

    Joined:
    Jun 29, 2009
    Posts:
    9
    Hello Everyone,

    I have been studying the 3rd Person Platform tutorial, and I am trying to understand how the camera set up works in the game.

    In particular, I have been removing chunks of code trying to isolate the part that tells the camera to distance itself from the character. I would like to eventually create a camera set up in the same vein as Resident Evil and Silent Hill where the camera follows directly behind the player, but it allows the player to turn and face the camera and move toward it with the camera continuing to keep its distance.

    I understand that vectors and rays can be used in the code to keep the camera at a certain distance, and they can be used as triggers, but I am unsure of this because I am new to Unity and scripting.

    Could some one point out in the 3rd Person Platform scripts where the player and camera effect is taking place and explain it?

    Thank you.
     
  2. yahadi

    yahadi

    Joined:
    Jun 28, 2009
    Posts:
    36
    What you want to use in this case is the Orbit Camera which is located in the scripts folder.

    It allows you to set the distance from the character too.
     
  3. antisymmetry

    antisymmetry

    Joined:
    Jun 29, 2009
    Posts:
    9
    Hello,

    Thanks for the reply yahadi. The Orbit Camera is nice. I also like the Spring Follow Camera OK, but I just wish I understood the code working in the script better. I have been trying to grasp it, but it is a process.