How do I make OnEnable execute for instantiated objects?

Upon testing things in my game, when I instantiate a prefab, its components’ Awake method gets called, but not OnEnable.

I need OnEnable to trigger for all of those, so yeah…

Looks like your script is inactive (checkbox is disabled) so that OnEnable is not working. Take a look at Prefab and see if script is enabled (or game object is active).

(for those who could also face the problem)

I came across this and my issue was that I was being a silly goose… I had named my OnEnable function “onEnable” and the case-sensitivity tripped me up.

This might not be a mistake other, more experienced Unity devs make but I’m putting it here to serve as a sanity check for anyone else coming across this