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")
- Here’s a screenshot of my scene dock: https://1drv.ms/i/c/94e3a7650209face/EdcNVb5T12ZCvLcLS6QUS_UBWulS6HwML__ejtHwFxNmMQ?e=NBKTYi
- Here’s a short video I uploaded of my running game:https://1drv.ms/v/c/94e3a7650209face/EYkBFporGoFKhRXGGoXhubYBNHEKMFkMchTY1y3XDC_RbQ?e=prtBvA