#**I want to add hitstop but timer does not work**

1 messages · Page 1 of 1 (latest)

shell sedge
#

I want to add hitstop when I jump on my enemy But I’m having trouble with it. The timer do stop when I change the Engine time scale..
Can anyone help me figure out what I’m doing wrong or link me to an answer for reference? I’ve looked around but couldn’t find anything.

  • Here’s my code:
func frame_freeze():
    Engine.time_scale = 0
    await get_tree().create_timer(1, true, false, true).timeout
    Engine.time_scale = 1.0
    print("idkdk")
split sparrow
#

My guess is that your issue is that the timer is either paused or it is never created to begin with due to you stopping the engine. Try creating the timet in the editors node tree so that you can adjust the "process" setting to "always" or "while paused".