Basic BoxTrigger collision

Here is my code:

	private Collision ball = null;
	

	// Use this for initialization
	void Start() 
	{
	
	}
	
	// Update is called once per frame
	void Update() 
	{
		OnCollisionEnter(ball);
		
		
	}
	
	void OnCollisionEnter(Collision check)
	{
		if(check.gameObject.tag == "Player")
		Debug.Log("HIT HIT HIT");
		//Application.LoadLevel("FirstDragTest");
	}

It seems so simple but it’s doing my head in. Can’t find an example anywhere. New to Unity scripting so I could really use some help on this one. I want to send a message when the my ball object hits the floor.

There are so many posts on this topic already. Please search before asking. And if stuck, ask a precise question : what doesn’t work? Where is the error? What does the documentation say? Are there any examples in the documentation?

http://answers.unity3d.com/questions/502040/ontriggerenter-is-not-running-need-help-with-colli-1.html

Hello! I got something working like this

  1. Created a Plane and a Cube GameObject

  2. Gave the Cube a RigidBody ( this would be your ball )

  3. Set the Cube tag to Player

  4. Added this c# script to the Plane ( named Floor )

       using UnityEngine;
       using System.Collections;
        
    
    public class Floor : MonoBehaviour {
    	 void OnCollisionEnter(Collision check){
           if(check.gameObject.tag == "Player")
           Debug.Log("HIT HIT HIT");       
        }
    }
    

Thanks Orlando, sorry for the delay. That’s exactly what I needed and have made progress on my game idea. Thankyou!