Godot Version 4.3
Hi,
in my main scene I instantiate a custom ui and a player node.
In my custom ui I use parse_input_event(jump_action) which should be consumed by my player node with is_action_just_pressed().
Unfortunately it does not work, because parse_input_event() apparently keeps the last action as long as some other action was triggered, so is_action_just_pressed() returns true only if previously another or none action was used.
The obvious idea would be to use an idle action after the logic after is_action_just_pressed() was executed, but I would like to know what the best practice in this case is.
I attached a minimal reproducible example in one script, since the described effect already occurs like this.
extends Node2D
func _ready():
InputMap.add_action(“jump”)func _process(_delta: float) → void:
var action_event = InputEventAction.new()
action_event.action = “jump”
action_event.pressed = true
Input.parse_input_event(action_event)func _physics_process(_delta: float) → void:
if Input.is_action_just_pressed(“jump”):
print(“Jump was just pressed”)