hi men.
i have a big problem, but there’s 2 solutions. I explain the situation: i have 2 players and i must check if the two one is in the end of the level.
here is the solutions:
-
you can use 1 trigger and check if there 2 entity inside, but i don’t know how to do this
-
you can use 2 triggers and chech if they contain 1 entity each. (sorry for my bad english, I’m French and i hope you understand me). but here agen i don’t know how to “separate” triggers.
i have a begining of code.
here is:#pragma strict
var cible : GameObject;
var trigger1 : GameObject; //i put the trigger1 here
var trigger2 : GameObject; //i put the trigger2 here
private var interrupteur1: boolean; //interrupteur is button in french
private var interrupteur2: boolean; //interrupteur is button in frenchfunction Start () {
interrupteur1 = false;
interrupteur2 = false;
}function OnTrigger1Stay2D() {
interrupteur1 = true;
}
function OnTrigger2Stay2D() {
interrupteur2 = true;
}
function OnTriggerExit2D() {
interrupteur1 = false; interrupteur2 = false;
}
function Update ()
{
if(interrupteur1 == true){
if(interrupteur2== true){
cible.transform.Rotate(Vector3.forward*(100.0Time.deltaTime1));
}
}
}
please help me, because i’m on this javascript sins 2 weeks and I can’t find what i surch.
thank you