- Home /
Can big problems occur when changing execution order of scripts?
The case with me is I have many gameObjects to which are attached many scripts. When I open the execution order menu I only see one separator called Default time. Let's say I want to change just one script to be executed before another one. For example just to swap the ex. order of 2 scripts and without affecting anything else. I read the docs about execution order, so no need reciting senteces from there. I read that changing the execution order of some script might also affect the meta data of other scritps which is the thing I don't want to happen or the thing I don't understand how does it work. Long story short: I want to make sure 1 script is being executed before another without spoiling any dependecies. How can I achieve that?
I'm not really sure about what kind of problems may arise, but in case you are trying to do something simple you can try using the Awake methods for the objects you want to initialize before , and use the Start method for the others. Same for the updates, use Update for the ones you want to actualize first, and LateUpdate for the others
changing the execution order of some script might also affect the meta data of other scritps
Where did you see this?
The manual says :
"When a number is changed, either manually or automatically, it changes the meta file for that script"
i.e. not for other scripts, but for the same script.
http://docs.unity3d.com/$$anonymous$$anual/class-ScriptExecution.html
Answer by DaDonik · Jan 19, 2015 at 11:03 AM
1) make a backup of your project...just in case
2) Change the execution order of your scripts like you would like to.
3) Profit...or revert to the backup
Joking aside, the thing is that some of your scripts may already depend on each other in a way that can get messed up if you change the execution order. Thats the main reason it's 'dangerous'. It is highly depending on your code and therefore you have to try it to make sure it works, or doesn't work.
Good luck =)
Execution Order is strictly for Last Resort usage. Only use it for instances where good program$$anonymous$$g technique does not solve the issue.
Your answer
![](https://koobas.hobune.stream/wayback/20220613180836im_/https://answers.unity.com/themes/thub/images/avi.jpg)