problems with function "OnCollisionEnter" text isnt Blue as it should be

ive written this in Java Script:
function OnCollisionEnter(theCollision : Collision){
if (theCollision.game0bject.name==“Terrain”)
{
Debug.Log(“OMG”);

}

}
but it doesnt work

it shows : “NullReferenceException: Object reference not set to an instance of an object” instead “OMG”

If that is an exact copy of your code
You have: if (theCollision.game0bject.name==“Terrain”)
you have a 0 where there should be an O,

if (theCollision.gameObject.name==“Terrain”)

that is the only thing I see wrong, I mainly use c# though :stuck_out_tongue:

ive written it right , just a mistake in this post. Its not even that , this script “function OnCollisionEnter(theCollision : Collision)” OnCollisionEnter is not colored as it should be i think something is wrong with the options or something like that idk

its done its done thx