|
if i have a variable set in an update function, that has to be inside the update will this keep on setting it every frame, or does it just do it once until it has changed..
(comments are locked)
|
|
The function update runs once per frame, and keeps on repeating this every frame. i thought as much, ill have to rearrange my code
Aug 04 '12 at 05:47 PM
reptilebeats
(comments are locked)
|
|
If I correctly understood your question, variables declared inside a function are temporary and must be initialized each time the function runs, while variables declared outside any function are member variables - they are initialized once when the script instance is created and retain their values while the instance exists: You also have the properties, which are a kind of virtual variables accessed by dedicated routines known as getter and setter - usually the setter routine does nothing unless the current value is changed (equal values are ignored).
(comments are locked)
|
