Hey all,
I’m having this random issue all of a sudden with variables. Here’s what my script looks like:
var player : GameObject;
function Update(){
}
function OnTriggerEnter () {
player.GetComponent("FloatingCharacter").isInWater = true;
}
function OnTriggerExit(){
player.GetComponent("FloatingCharacter").isInWater = true;
}
As I understand it, the “var player : GameObject” is supposed to create an area in the Unity GUI where I can drag&drop a GameObject. It’s outside all the other functions, so it should be global. This is the way I’ve always done it and this has always worked. Now for some reason, it is suddenly not.
Have I just gone insane and I’m missing some blatantly obvious thing? This is how it looks in all my other scripts, which do work. Any idea what could be going on?
Thanks for your help!