Does OnEnable gets called when an object is activated?

It was my understanding and what the documentation states but in this scene, OnEnable doesn’t get called on the child when the parent gets activated by parent.gameObject.SetActive(true).
Are there exceptions to this? Bug maybe?

Is the child active?

OnEnable will be called when the object is made active. Any chance of a typo in the method name?

Should work correctly, using this myself on numerous occasions and OnEnable gets called correctly

It was a ‘me’ error, I was relying on animator setting a component enabled and not code setting GO active, this is fixed and now everything works well.

1 Like