- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
Javieror · Jan 16, 2014 at 05:52 PM ·
static-variables
I can´t get the value of a static var - strange
Hello,
I am new in this and I don´t understand why this is happening.
I made 2 JS and I want 2 of the values to be copied to one script, the thing is that only one of the values are copied!! and both are the same type... I don´t undestand...
On JS: Boton
static var velocidad : float;
static var velCambio : float;
function Start () {
velocidad = 3.0;
velCambio = 1.0;
}
On JS: CuboI
var velocidad = Boton.velocidad; //speed
var velCambio = Boton.velCambio; //speed of image change
Please, can you explain me why only variable "velCambio" is properly copied??
Thanks
Comment
Answer by frogsbo · Jan 16, 2014 at 06:05 PM
try to not use static.
it isnt used in actionscript for unity.
http://answers.unity3d.com/questions/321385/static-variables.html
Your answer
Follow this Question
Related Questions
Static Variable Not Assigning Half The Time? 1 Answer
Static variable or static property? 1 Answer
problem with selecting characters script 0 Answers