Is there a way to dynamically change the timescale/duration of a tween after it has started playing?

Godot Version

4.3

Question

I am using tween to zoom in the camera, but it doesn’t seem to change the value dynamically. Killing it doesn’t seem to work either. I have tried both in _input and _process but it doesn’t seem to change the tween timescale/duration dynamically.


How do I go about this? This is a simplified version but basically in my game scene I’m showing a path and I want to be able to skip/make the camera animation fast when the player wants to skip.

zoom_fac = .1

Isn’t this what you need?

zoom_fac *= .1
tween.set_speed_scale(zoom_fac)
1 Like

This still plays the last tween(slower zoom) after running the faster tween

(I changed zoom_fac to 2.5, 0.1 was a little too slow to notice the zoom speed difference)

I don’t understand, what’s the problem now?

I don’t want the last tween to play. I just want the new faster tween to play and stop.

So use this code for play tween just one time:

tween.set_loops(1)
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.