Two different triggers

hey, I’m trying to make two different triggers with different functions.
But there is an error and I don’t know what I shall do to fix it.

here’s the code:

void OnTriggerEnter(Collider theplace)
{

	//Knapp kommandon, i detta fallet space för att platsa in
	if (Input.GetButton("Jump"))
	{
		print("dun dun DUN!");
		 //Camera.main.transform.Translate(1,1,1);
		
	}
	
}



void OnTriggerEnter(Collider other)
{
	print("Checking");
	Health --;	
	
}

it’s Collider other that doesn’t work.

I use C sharp

Ok I understand your question now :slight_smile:

Create two triggers in your scene. Then attach a seperate script to each trigger with an OnTriggerEnter method.

When each trigger is collided with, it will call the relevant OnTriggerEnter event on the script attached to the trigger.

Assure that at least one of the two gameobjects has a RIGIDBODY attached to it.
There’s a specific matrix that tells you when you can use triggers: at least a rigidbody is a requirement for them.

check it out:

http://unity3d.com/support/documentation/Components/class-BoxCollider.html