I'm trying to make button-controls for my character.
The character is a KinematicBody2d and moved using the
Everything works as expected when using input_map and mapping keys, and using
is_action_pressed, but when trying to programatically create an action, it does not work.
I want to add a button, so when clicked, it fires the same action as the key-input.
In the button:
var ev = InputEvent()
ev.type = InputEvent.ACTION
I can see the action in the
_input-function of my character, but the
_fixed_process does not catch the action.
From my character:
if not event.is_echo() && event.is_pressed():
So..what is the difference between an action set using Input Map (prints "Move Right" from both
_input) and explicit defining an action in code (only prints "Move Right" from
What is it I'm not understanding here?
From other examples I've seen that some move their character directly in the _input-function, and that would solve my problem, but still I don't get the difference between setting an action in Input Map and using a script.