static var not working?

Hi there,
I just set the var as in x script

static var ersOn : boolean;

now from y script when I ask if ersOn true or false I get an error of unknown identifier.

What giveth?

post the line from script y.

It sounds like the identifier may be the actual script name.

Make sure it’s in the scene. Or named correct

function Update()
{
if(ersOn == true)
return;
}

You access static variables with ScriptName.variableName

Oh, sorry. Thanks.