0
Answered

Destroy

Sukha 1 year ago updated by Lazlo Bonin (Lead Developer) 1 year 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 1 year 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());