Can't get time slowing to work.

Godot Version

4.7.2

Question

I’ve been trying to make a slo-mo feature, but when I press the focus button, (which is bound to my T key) nothing happens. I feel like i’ve done everything right?

func _physics_process(delta):
	if Input.is_action_just_pressed("focus"):
		Engine.time_scale = 0.4
	else:
		Engine.time_scale = 1.0

Your time is slowed down, but only for 1 frame, then it is reverted back to normal. You could add print() statements to your code to understand why it happens.

You should use _unhandled_input() instead of _physics_process().

Using Input.is_action_pressed instead of Input.is_action_just_pressed should do the trick!

This worked, tysm!