Destroying the prefab instance after a delay

Is there a good reason not to use this instead?

    Destroy(instance.gameObject, destroyDelay);  // iff destroyDelay >= 0

Seems to work, although maybe the MonoBehaviour Coroutine infrastructure is useful later on in the course?

EDIT: Ok, I see what the point of it is now - we want to call finished after the prefab instance is destroyed, so the ability to use our own Coroutines in the SO is useful.

2 Likes

This calling a Coroutine with an existing Monobehavior is a vital part of our ability paradigm. They simply cannot be run normally on a ScriptableObject. We probably can use Destroy in some cases, but yes, we would be unable to call back from the destroyed object in this case.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms