Do I have to unsubscribe an event if the object is destroyed? Looks like it.

Edit: looks like it by using google. Apologize I didn’t search first.

You will probably get null pointer exceptions if you don’t cleanup your code and manage everything upon “OnDestroy” or OnDisable.

OnDisable gets called before a MB is destroyed, so sub to it in OnEnable and unsub in OnDisable.

Or use a unityEvent

2 Likes