Is Awake called again when using SetActive?

If I deactivate an object, then activate it again, will the awake function be called again? If not, how can I make something like Awake() but only run it when that gameobject becomes active? Thanks

Awake gets called once in the GameObject’s lifetime.

Look into OnEnable and OnDisable

4 Likes

Thank you so much! :slight_smile:

Don’t forget about Start()

Start() only gets called once in the GameObject’s lifetime

http://www.richardfine.co.uk/2012/10/unity3d-monobehaviour-lifecycle/

I missed the fact that he wanted to deactivate then reactivate the go…

But thanks for the link, awesome diagram.