JavaScript collision code problem.

This very simple piece of code is supposed to change levels when the game object it’s attached to hits a specific game object. The problem is when the two objects collide the scene doesn’t change. Here is the code:

#pragma strict

function OnCollisionEnter(CrystalCollision : Collision){
		if(CrystalCollision.gameObject.name == "Crystal"){
				Application.LoadLevel(0);
		}
}

-Thanks

Try to use CrystalCollision.gameObject.name.Equals(“Crystal”) to compare the string