Search code examples
c#unity-game-enginelifecycle

Unity - If I create two scripts with its own Start() method, which one will call first?


I created two simple scripts (ScriptA and ScriptB). Both contained Start() method. I found that the later one always started first. Is it the normal way of Unity to do?


Solution

  • From the Unity Documentation:

    By default, the Awake, OnEnable and Update functions of different scripts are called in the order the scripts are loaded (which is arbitrary). However, it is possible to modify this order using the Script Execution Order settings (menu: Edit > Project Settings > Script Execution Order).