OnEnable, Awake, Start

playmode start run like this:

  • OnEnable
  • Awake
  • OnEnable
  • Start
    (by debug.log)

2 questions:

  1. why OnEnable twice ?
  2. order execute above (onenable first) - is guaranteed?

Order of execution is here: Unity - Manual: Order of execution for event functions

OnEnable is likely firing twice due to the domain reload that happens when entering play mode. If you disable it you potentially won’t see it twice.

2 Likes