#Why is this `input_event` signal not firing?

6 messages · Page 1 of 1 (latest)

grim kelp
#

I have a CharacterBody2D scene with a script attached. I have set pickable to true in the inspector, and I've also hooked up the input_event signal to the script.

Here is the full script:

extends CharacterBody2D

signal player_selected(pos)

func _on_player_selected(pos: Variant):
    queue_free()

func _on_input_event(viewport: Node, event: InputEvent, shape_idx: int):
    print("click")

However I'm unable to get the print to actually print anything, which indicates to me that the input_event signal isn't firing. Any ideas why it's not working as expected?

#

Forgot one of the screenshots, sorry

rose tinsel
#

Are there any Control nodes in the scene? Beware that Control nodes, being made for UI, will all process input events before physics nodes even if they are below in the tree. So if a Control node is overlapping the player, even in the background, it could be consuming the click.

grim kelp
#

Huh, that's probably it. I do indeed have a control node

#

I don't really know how to properly set up a UI yet so I've probably messed something up

rose tinsel
#

Look through the control nodes you have, and for each one that shouldn't be clickable, you can set its Mouse > Filter property to "Ignore", which will prevent it from consuming input events.