0
Answered

Destroy

Sukha 3 months ago • updated by Lazlo Bonin (Lead Developer) 2 months 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 months 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());