Input.is_action_pressed() not working!

Godot Version

4.4.stable

Question

Now this is confusing. Input has worked for me and I’m wondering if this is a 4.4 change. Nothing happens when I do the action. I have checked that my action is correct, and does have keys connected. I have tried changing the action inside the parenthesis. And the script IS connected to the game. (If I were to put a print() right inside the process it would print it, but not inside the if statement) It really feels like a Godot bug. Thanks!

func _process(_delta: float):
	if Input.is_action_pressed("forward"):
		print("Moving Forward")

I’m sure it’s obvious but make sure that “forward” (case sensitive) exists in the project setting’s InputMap.

I have. I have even tried replacing forward with “ui_right” and other actions but it won’t work.

It’s working now! I restarted Godot and it works. So does that mean it’s a Godot 4.4 bug then if I had to restart it? Should I report it?

2 Likes

Unless you can create a project where this behaviour can be reproduced consistently, it was most likely an issue on your machine / something with your project, incorrect cache perhaps.

Okay, thanks! :smiley:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.