Timer / Engine.time_scale ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By morningkingdom

Hi, for a skill effect (slow motion) im using Engine.time_scele = 0.5, and its okay.
but im checking skill cool down with timer. because of time_scele = 0.5, timer go down slowly. can i exempt the timer from time_scele ?

:bust_in_silhouette: Reply From: MrEliptik

Engine.time_scale will affect everything and you can’t make exceptions. You could take it into account with your delta in _physics_process and _process.

If you want more control you could define your own time scale, being 1.0 by default and scaled however you want when you need to slow or speed up time. You then use this value with deltato control at which speed things should go. This allows you to only slow the process function of a character for example, without affecting timers or anything else.

This is old so I’m sure you’ve already solved it or don’t care anymore, but for anyone with this issue just multiply your timer by the timescale you choose.

I don’t remember GDS syntax but

Make a variable timeScale = 0.5
Engine.time_scale = timeScale
Set the timer duriation = duration * timeScale

It will make the timescale half and it will also make the time the timer runs for half.

3 Likes