Why doesn't work when I change the engine speed?

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

When I change the engine speed ( Engine.time_scale = 0.15 ), it doesn’t work anymore or atleast it does but in an unnoticable scale. I want it to “jump” the same amount in Engine.time_scale = 0.15 as it does in Engine.time_scale = 1.

:bust_in_silhouette: Reply From: Tato64

Without seeing the code, im sure it’s because your gravity calculations depend on the framerate of the game, and since you have “more frames per time” when time is slowed, gravity acts way more in the duration of the jump.

You could just change the gravity depending on the timescale like:

if Engine.time_scale == 1:
     gravity = 10

elif Engine.time_scale == 0.15:
     gravity = 1.5