Hey I am havin a small problem, I have a script called CharacterScript in that script I am defining a PlayerState which works fine.
No I wanted to create a new Object which needs the information if the Player is in PlayerState 1 or 2.
May script so far is:
var StateScript: CharacterScript;
function OnTriggerEnter (collisionInfo : Collider){
StateScript = GetComponent(CharacterScript);
if (collisionInfo.gameObject.tag == “player” && StateScript.PlayerState == 1){
Destroy(gameObject);
}
}
Somehow it does not work, seems like the object is not recieving the PlayerState… What did I do wrong ?