D
D
Dacknar52013-12-18 19:55:36
Unity
Dacknar5, 2013-12-18 19:55:36

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"){
}
}

Here are 2
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

1 answer(s)
G
GreatRash, 2013-12-19
@Dacknar5

It ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question