So I’m trying to access a variable from one class inside the script of another.
In this particular case I want to get a return of a bool variable named attacking from player
so for example
public player plyr;
plyr = gameObject.getComponent();
if(player.attacking){
…
}
I tried returning the bool variable in a function, but I’m having just as hard of a time getting a class to call another class’ functions. So if anyone can tel me how to do this, that’ll be awesome. Cause the documentation doesn’t seem to help me much in this regard. Thanks!