Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Can't get collision with player controller

Discussion in 'Editor & General Support' started by McMunchly, Apr 29, 2012.

  1. McMunchly

    McMunchly

    Joined:
    Apr 29, 2012
    Posts:
    4
    So I'm trying to make it so a player touches a trigger which causes the scene to change.

    I have the default first-person character controller which is tagged as 'Player', and a box collider. I gave the box collider this script:
    Code (csharp):
    1.  
    2. function OnControllerColliderHit(collision:Collision)
    3. {
    4.     if(collision.gameObject.tag == "Player")
    5.     {
    6.         Application.LoadLevel("house");
    7.     }
    8. }
    9.  
    Yet when I touch the box with my controller the scene doesn't change. What gives?
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Welcome to the forum!

    It is very likely that you find the answer here: Unity Answers.