- Home /
How to control order of executiing scripts?
I have RTS engine where each unit has pack of UnitBeahviourAI scripts which control this unit and give it orders. Those scripts often give orders at same time and I'd like to execute more priority scripts at last place to save their orders. For example: there are two scripts UnitBehaviourAiAttackNearest and UnitBehaviourAiFleeOnLowShield. "Flee on low shield" is more priority script and when unit has low shields it sholdn't attack. So, is there a possibility to control order of those scripts or any other way to realize priority of Ai those scripts.
Thanks.
Answer by jmhoubre · Jul 21, 2020 at 10:17 AM
Hello, have you looked, in the projects settings, the part "Script Execution Order"? Good luck (sorry for any mistakes in English).
No didn't know about this setting. Now it works. Thank you!
Your answer
Follow this Question
Related Questions
How do i have AI objects have teams and attack when in range 3 Answers
Distribute terrain in zones 3 Answers
RTS dynamic formation width and length 0 Answers
Boids/Flocking Tutorial 0 Answers
Multiple Cars not working 1 Answer