0
Answered

Destroy

Sukha 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 1

What is the correct way to get "Destroy()" to respect Timeline?

Tried with Coroutines and various time.WaitForSeconds() and Timeline.Destroy() etc.

Chronos Version:
2.4.14
Unity Version:
2018.3
GOOD, I'M SATISFIED

Cool, thx

Satisfaction mark by Sukha 2 years ago
Answered

Hi Sukha,

Sorry for the very late reply on this.

You cannot use the Destroy overload that just takes seconds, as this is not aware of Chronos.

You can either start a coroutine, and in it, use Timeline.WaitForSeconds, then Destroy (instantly) after.

Or you can use Occurences, like this:

 Timeline.Plan(seconds, () => gameObject.Destroy());