Thanks, yes like that but I should have mentioned I'm using React.
I am setting the overall tl speed like so: W
tl.current.timeScale(speed);
then i'd like to be able to click a button and have that change. I'm trying to set speed to a different value on click, then have a use effect watch that and update the tl timescale if it changes:
useEffect(() => {
if (tl) {
tl.current.timeScale(speed);
}
}, [speed]);
The function is being called, and passing the if condition, but it causes the timeline to end, rather than changing it's speed.