Censor
December 19, 2021, 3:47pm
1
Hi, I’m trying to get an advanced timer to run a function that I add to the onTimerEndedObservable.
See this playground:
https://playground.babylonjs.com/#X2ARP6#1
I’m not sure why the function does not fire.
I pretty much copied what is written in the doc here:
What am I missing?
1 Like
Blake
December 19, 2021, 5:42pm
2
The timeout option is currently being ignored by AdvancedTimer’s constructor. This PR will fix the issue but in the meantime you can use the timeToEnd parameter of the start method instead.
https://playground.babylonjs.com/#X2ARP6#2
BabylonJS:master
← BlakeOne:master
opened 05:36PM - 19 Dec 21 UTC
The property "timeout", which is part of the ITimerOptions interface, is current… ly ignored by AdvancedTimer.
This PR adds support for it by initialing _timeToEnd in the constructor to the value options.timeout. This value will be used unless a new timeToEnd value is passed to the start method.
Forum post that flagged the issue: https://forum.babylonjs.com/t/advanced-timer-function-does-not-run/26173
4 Likes
Censor
December 19, 2021, 6:18pm
3
Thanks for the quick reply, temporary solution and PR
1 Like