Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

MonoBehaviour OnEnable not called:official document error !

Discussion in 'Documentation' started by walker_snapmaker, Aug 18, 2017.

  1. walker_snapmaker

    walker_snapmaker

    Joined:
    Jan 18, 2017
    Posts:
    1
    Here is official document : https://docs.unity3d.com/2017.2/Documentation/ScriptReference/MonoBehaviour.html

    Focuse the top lines :
    OnEnabled() ?
    Are you kiding me ?
    MonoBehaviour is so important ! OnEnable() is important , but the doc is wrong .

    The right name of the callback method is "OnEnable()" !
    I hava spent 2 hours to check the problem : OnEnable() not called.
    Because in my script, I use OnEnabled() !

    Thanks for misleading me by "Official Document".
     
  2. Ironmax

    Ironmax

    Joined:
    May 12, 2015
    Posts:
    890
    Personally i don't use OnEnable at all, i rather use my own logic, with Initialize that can be call from another script true Interface