Create a one-shot timer that fires once after the specified duration.
Duration in seconds until the timer completes
Optional
Optional configuration including onComplete callback
Component object suitable for spreading into spawn()
// Timer without callbackecs.spawn({ ...createTimer(2), explosion: true,});// Timer with onComplete callbackecs.spawn({ ...createTimer(1.5, { onComplete: (data) => console.log('done', data.entityId) }),}); Copy
// Timer without callbackecs.spawn({ ...createTimer(2), explosion: true,});// Timer with onComplete callbackecs.spawn({ ...createTimer(1.5, { onComplete: (data) => console.log('done', data.entityId) }),});
Create a one-shot timer that fires once after the specified duration.