I have a very simple setup (just started with Unity, so keeping it simple) of a plane with a rigidbody cube sitting on top of it, with a rigidbody sphere hovering directly above the cube. I have created a script called “Collision.js” which has the following:
function OnCollisionEnter(collision : Collision)
{
Debug.Log("Collision: " + collision.gameObject.tag);
}
When attempting to run the game, I always get this error:
Script error: OnCollisionEnter
This message parameter has to be of type: Collision
The message will be ignored.
Does anyone know why this is? It’s very perplexing, as I’m doing (seemingly) exactly what the compiler is complaining about me not doing, which is setting the parameter to the type “Collision”…
Thanks in advance for any help.
Biff