OntriggerEnter is already defined?

void OnTriggerEnter(Collider Col){
if (Col.gameObject.tag == “Player”) {
transform.FindChild (“door”).SendMessage (“DoorCheck”);
//It says that I need to change the name. However, I have already changed the name. Wat do?
void OnTriggerEnter(Collider Fireboys){
if(Fireboys.gameObject.tag == “Player”){

Hello! I’m setting up two different OnTriggerEnter’s, but it says that they’re already defined. Can I not have more than two OnTriggerEnter’s in one script?

At least, I assumed that, so I put the second OnTriggerEnter into another script: using UnityEngine;
using System.Collections;

public class tiggerzone2 : MonoBehaviour {

// Use this for initialization
void Start () {


// Update is called once per frame
void Update () {

void OnTriggerEnter(Collider Fireboys){
	if(Fireboys.gameObject.tag == "Player"){


Apparently, now it’s missing Monobehaviour, and useful things like GameObject, Collider, Find, SendMessage… You get the idea. What is even happening?

Because “OnTriggerEnter” is a Unity Function, it can only be defined once, per script, however you should never declare the same function more than once.

You may not understand the function properly:

the “Col” is just a name defined by you, that you can use to refer to the object that entered the trigger. You should then be testing for that objects name or tag, by using

   if(Col.gameObject.tag == "lowatevahTAG")


   if(Col.gameObject.name == "lowatevahNAME")

The function is called no matter what object enters the Trigger.

The name of the parameters don’t matter. They’re still the same method.

2 things make a method call signature unique:
(1) method name (OnTriggerEnter)
(2) parameter list. (Collider x)

You can’t have more than one method in the same class where these two elements are the same. The names of the parameters DOES NOT MATTER. It’s just a label.

What are you trying to achieve by putting two anyway?