Skip to content

Instantly share code, notes, and snippets.

@phoenixperry
Created October 8, 2013 18:09
Show Gist options
  • Save phoenixperry/6888925 to your computer and use it in GitHub Desktop.
Save phoenixperry/6888925 to your computer and use it in GitHub Desktop.
Example of OnCollisionEnter in Unity in c# from Unity 3d Student
void OnCollisionEnter(Collision theCollision){
if(theCollision.gameObject.name == "Floor"){
Debug.Log("Hit the floor");
}else if(theCollision.gameObject.name == "Wall"){
Debug.Log("Hit the wall");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment