all the sudden static vars are forbiden ...

guys… as i undestand… one can only create a static var before the update function is that correct? … beucase i tried this

function LateUpdate () {

static var misileimpact = targets.GetComponent (Vector3);

}

and it says some bullshit about expectin } found static ¬¬

then i tried in the colision function

function OnTriggerEnter(other : Collider){
if(other.gameObject.tag == “aimable” wasTriggered == false){
mySphere.radius = 0;
targets = other.gameObject;
wasTriggered = true;

var alvo = targets.GetComponent (Vector3);

static var misileimpact = targets.GetComponent (Vector3);

}

same thing… expecting } found static… wth… why is this hapening?.. i need to be able to send these informations outside so other scripts can know about that vector3

EDIT:: NEVERRMIIINDDD SORRY IM REALY SORRY ABOUT POSTING JUST DONT REPLY IGNORE THIS TOPIC UNTIL HE DESAPEAIRS

You cannot create static variables within functions. It doesn’t really makes sense as a static variable with function scope is unusable outside the function anyway(and all variables declared within functions are only usable within those functions). Either declare it outside of functions and within the class, so that it has class scope, or declare it non static within the function, but it can’t be accessed outside that function.

yea i just realized that i been trough this problem before and i found a way arround it sorry for the troubling