Answer the question
In order to leave comments, you need to log in
How to refer to another variable in JS Unity3d?
I want that when I go into the trigger, and I press the E button, the animation should play.
If I went into the trigger hz should be 2, and when it is 2 then HD from another variable should be 4.
Here is 1
var hz = 1;
function OnTriggerEnter (col:Collider) {
hz ++;
if(hz == 2){
asd.hd ++;
}
if(Input.GetKeyDown ("e")){
}
if(col.tag == "Player"){
}
}
public var hd = 3;
function UpDate(){
if(hd == 4){
animation.Play("Button");
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question