func _slowtime():
if Input.is_action_just_pressed(“Slow”):
print(“test”)
Engine.time_scale = 0.5
print(“test2”)
i want it to slow the game time down when pressing the “e” key but it doesn’t work nor does it print either test (i tripled checked i set it to the right key and even tried changing the key)
You seem to be lacking an understanding of how functions work. Other than built-in functions like _process or _input, Functions need to be called explicitly (by you) from somewhere to do anything.
The line if Input.is_action_just_pressed("Slow"): is never even checked because the engine doesn’t know it’s supposed to be checked. You need to move it into _process, _input or _unhandled_input and then call your function _slowtime() from there:
By the way, names with an underscore at the start shouldn’t be used for your own functions because the name signals that the function was declared in a native script and is supposed to be overriden, that’s why I changed the name from _slowtime to slowtime