|
If I attach two monobehaviour scripts to one GameObject,is the Update order predicable? For example: First I attach aaa.cs and then attach bbb.cs, unity engine will call aaa.Update() bbb.Update() ?? Very thanks.
(comments are locked)
|
|
The order in which Update is called is undefined, so no, the order is not predictable, unless you use the script execution order which MIke mentioned.
(comments are locked)
|
|
Update is called once per frame, I don't think that you would be able to predict which script is called first. Just did some testing and the script I attatched to the game object last got called first, but this can also be random, I'm not sure at all. May I ask what you need this for? :)
(comments are locked)
|
|
You can set the script execution order in Unity, which according to the 3.4 release notes includes Update() commands. Tutorial on how to set this is here
(comments are locked)
|
