- Home /
Performance and scripts
Hello,
what is the best practice for a strategy game, is it better to have:
The same IA script attached to several gameobject, and work with each update function
An unique IA script called once, and that will browse all the gameobjects to handle ?
Answer by FlaSh-G · Aug 11, 2017 at 07:10 PM
People have tested that and my latest info is that calling a bunch of custom update functions is faster than having the same amount of Update calls from Unity directly. Might want to just test and benchmark that for yourself though.
Having a central place to manage lots of updates gives you more control over timing either way. You might want to update the AI less often than the game's framerate.
Your answer

Follow this Question
Related Questions
How Much code can be put in a start function? 1 Answer
How Can I Change Sprite Max Size,Format and Compressor Quality in My Script 1 Answer
Advice on reducing amount of direct referencing. 0 Answers
Script Performance: 1 central or many independent? 2 Answers
I think I abuse of Ressources.load 2 Answers