Search Unity

Changing camera's based on where the player is in the scene.

Discussion in 'Scripting' started by kevdotbadger, Apr 15, 2012.

  1. kevdotbadger

    kevdotbadger

    Joined:
    Sep 13, 2011
    Posts:
    82
    Hay, I'm making a game where there's a bunch of prepositioned camera's. When the main player walks into a certain area the camera will change. Think early resident evil.

    How would I go about doing this? Should i setup a load of box colliders and have them as triggers and then change the camera when a collision happens with my main players collide? Is there a better way of doing this?
     
  2. diablo

    diablo

    Joined:
    Jan 3, 2011
    Posts:
    736
    Yes, this way you have good control over exactly when the camera should switch.
     
  3. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
  4. kevdotbadger

    kevdotbadger

    Joined:
    Sep 13, 2011
    Posts:
    82
    Tseng, this topic is different than my question. This deals with finding the nearest camera, I don't want that.

    Diablo, should I only check when the collision happens? Or should I be using onCollisionStay?
     
  5. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    While he asked for the nearest camera, he was probably meaning the same thing like you and just had a wrong approach/idea on archiving it. If you read my post (the last one, where the link leads to) it's exactly what you have been asking...