How to make a tween independent of time_scale?

Godot Version

4.3 dev5

Question

Does anyone know if it’s possible to make Tweens use real time instead of time_scale? My game has a lot of time_scale changes and when the time is slowed down, the tweened animation is slowed down with it, which I don’t need.

I can set the tween.set_speed_scale to 1 / Engine.time_scale, but this won’t work if the time_scale changes mid animation.

For example, in this video the animation for stamina and boss showing up is very inconsistent, what can I do here?

i think just send signal to update the speed scale of the tween when time scale got changed? do you have a variable to set the Engine.time_scale?

1 Like

Okay, I’ll try this, thank you!
Still, wish there was a simpler built-in solution, like Timer’s ignore_time_scale

it’s possible to not use signal, by using setter
so this variable that got changed that determines the Engine.time_scale have the custom set method like:

var the_tween:Tween
var current_time_scale:float=1.0:set=set_current_time_scale

func set_current_time_scale(new_value:float):
	current_time_scale=new_value
	readjust_time_scale(new_value)

func readjust_time_scale(_value):
	the_tween.set_speed_scale( 1.0 /_value)

1 Like

I didn’t even know about setters, thank you!!

1 Like