Problem with variables

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!

Maybe it's because of another error somewhere. Variable changes won't really show up in the Editor until the whole script has no errors. If there are any errors in your Update then you have to fix that before you will see any variables that you just added to that script even if you saved your changes in the script, it seems like it should be there but it's not. That's because you're stuck on another unrelated error. Fix that and the Editor will update and show GameObject...

If that doesn't work, maybe delete it and make a new script from scratch? Update Unity?