Search Unity

Make camera react to collider?

Discussion in 'Scripting' started by Treasureman, Oct 21, 2014.

  1. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    I'm making a 3rd person shooter (using a 1st person controller) and I want to know how to make my camera not go through objects with colliders, but instead have the camera stay in place (Every Over The Shoulder game has this if you back up into a wall or something, in case you need an example.
     
  2. DrSnake

    DrSnake

    Joined:
    Oct 17, 2014
    Posts:
    33
  3. MrPriest

    MrPriest

    Joined:
    Mar 17, 2014
    Posts:
    202
    You can put the camera inside an empty game object, and give it a rigidbody/collider. You can also play with the camera settings which have an option that might fit this problem.