JG22
1
I need this game to pass the level when the player collides with gameobject “ol”.
**void ControllerColliderHit(hit : ControllerColliderHit)
{
if (hit.gameObject.name == "ol")
{
Application.LoadLevel("1");
}
}**
I’m using it like this now.
Am I missing something ?
i think you are mixing up unity script and C#, the method declaration should be
void OnControllerColliderHit(ControllerColliderHit hit)
{
if(hit.gameObject.name=="ol")
{
Application.LoadLevel("1");
}
}
here is the documentation about the message OnControllerColliderHit .
what i wrote btw is c#, look at the differences in that link