Action ui_left enabled on project start

When I start the project the cylinder starts rotating left on its own without pressing the left button on the keyboard. This continues until I press the left key then the left and right movements start working as expected. See the code snippet below. I am using Godot 4.1.3.

Edit: There was apparently a small input coming from one of the other joysticks connected to my computer. Once I unplugged that the problem went away.

func _process(delta: float) -> void:
	if Input.is_action_pressed("ui_left"):
		rotate_z(delta)
	
	if Input.is_action_pressed("ui_right"):
		rotate_z(-delta)

I was having a similar, but different problem: My inputs would only be accepted once. Holding the button did nothing. Everything started working fine once I unplugged my controller.

1 Like

Hi. Don’t you have any code in func _ready :kissing: ?

Privacy & Terms