Question by
Isovald · Apr 06, 2016 at 06:15 PM ·
performance optimization
Removing a script if its only use is the Start function
Let's imagine there is an attached script to an object which goal is only to give to the object a start velocity in the Start function, but that the Update function does not do anything. Would there be any advantage to remove the script from the object at the end of the Start function, like a performance gain or anything ?
Comment
As long as there is no Update, FixedUpdate or LateUpdate function anyway, there will be no performance gain, I think.
The best thing to do though, is try it. If anything you'd probably gain a few kb in RA$$anonymous$$ or something.
Best Answer
Answer by Kurtisi · Apr 06, 2016 at 06:30 PM
If your only code is the one which is in the Start function there is really no need for destroying the script :)