- Home /
Is each call to persitante script creating a new script
I have seen how it is possible to create an empty game object and then have a script in it that holds all info. When calling it from another function does the script get created anew (aka start called again) or is this script just a single instance in the persitant gameObject which i get a reference to.
Answer by stingman · Jul 11, 2012 at 09:15 PM
the Start function is called when the object becomes active for the first time. it does NOT get called again until the scene is reloaded.
Thanks I have been using this but I was affraid of there being too many instances of the same script running and running out of memory
The update function is another story... Try and $$anonymous$$imize the amount of calls you make in the update function and always cache your objects in the Awake or Start functions to save memory and increase performance
I'm not looking for the script in an update function I have a function that gets called once when something is found and once when something is lost and even then only if a model is null does it call that component.
Your answer

Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Shooting Specific GameObject via Tag 0 Answers
Changing gameobject assigned to a variable on input.getkey. 2 Answers
Combine objects instantiated at runtime 2 Answers
grab all game objects with a distance of the object? 2 Answers