Godot Version
4.4.1
Question
When using the handle_input() I have within my state, it doubles the action. But when I move that same line to the owner, it doesn’t. Any ideas? Here’s how it looks:
(OWNER)
func _unhandled_input(event: InputEvent) -> void
state_machine._unhandled_input(event)
(STATE MACHINE)
func _unhandled_input(event: InputEvent) -> void:
state.handle_input(event)
(STATE //abstract class//)
func handle_input(_event: InputEvent):
pass
(STATE_1 //extends STATE)
func handle_input(event: InputEvent):
if event.is_action_pressed("left"):
owner.action.emit("Left")
elif event.is_action_pressed("right"):
owner.action.emit("Right")
When I move if event.is_action_pressed("left"): owner.action.emit("Left") directly to the owner class, it works perfectly fine. Thank you for the help!