Hello, i have planets on my game and if the character (with character controller) touches them something will happen for each planet my first try was to code each planet with ontriggerenter and write down the code after it but once i write another planets code after it gives me an error message saying “already has a definition for ‘OnTriggerEnter(UnityEngine.Collider)’.” here is my code
//planet 1
function OnTriggerEnter (Planet_Earth_Entry : Collider) {
Application.LoadLevel("Planet_Earth");
}
//Planet 2
function OnTriggerEnter (Planet_Mars : Collider) {
//destroy ship
destroy.gameObject.FindWithTag("Main_Character");
}
next since that didnt work i tried “oncollisionenter” but i couldn’t even get that to work no errors just didn’t work :S here is that code which i was just testing
function OnCollisionEnter(theCollision : Collision)
{
Debug.Log("Hit planet");
}
now my question is can i put multiple OnTriggerEnter’s on one script? because the only other way i can think to do it is by having a lot of scrips one for each planet and my plan for my game i would end up having 100 scripts… please help thank you