0 votes

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.

Godot version v3.3.2
related to an answer for: How to make blink ability in Godot 3D?
in Engine by (56 points)

1 Answer

0 votes

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
by (309 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.