Collider Issue

Hey Folks :slight_smile:

I got a small problem with my collider. This is my code:

function OnTriggerStay(other : Collider)
	{
		If(collider.gameObject.tag == "Player" || collider.gameObject.tag == "stone")
			{
			Switch = true;
			}

Unity is giving me this error message:

“Assets/buttonNU.js(37,56): UCE0001: ‘;’ expected. Insert a semicolon at the end.”

Do you know where my mistake is?

Cheers!

Dawnreaver

function OnTriggerStay(other : Collider)
{
If(collider.gameObject.tag == “Player” || collider.gameObject.tag == “stone”)
{
Switch = true;
}

  1. Missing a ‘}’ (close brackets) at the end of the code.
  2. It is a “if” and not a “If”.