Signal works in individual scene, but not when scene is placed in another scene

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jellylobster

I’m working on my first game with Godot. I’ve watched videos and read a bunch, but I can’t figure this out!

I am making a puzzle game where I need clickable tiles. I created a node that is an Area2D containing various sprites, a label, an animation player, and a CollisionShape2D so that I can use the input_event signal. When I run the tile scene by itself, the signal works, but when I place the tiles in the main game scene, the input_event function doesn’t seem to be called. The input_event signal is connected to the node itself. Below is the code, I’m not even having it do anything right now except print to the output tab just to try it out.

func _on_ItemTile_input_event(viewport, event, shape_idx):
	if event is InputEventScreenTouch:
		if event.is_pressed():
			print("object click" + str(item_number))
			print("object release" + str(item_number))

What may be happening is that other nodes in the scene are intercepting the input before the tile scene (e.g. some other Control node). That’s happened to me before. But I was using mouse input, not touch input. Nevertheless, it’s good to check the Mouse Filter property of any other Control nodes in the main scene.

Ertain | 2022-01-23 18:55

Bingo! I figured it was something like what you said, something intercepting the input, but I didn’t know about the Mouse Filter, and that’s exactly what it was! I had a background image, and the filter was set to stop. I set it to ignore and it started working. Thanks!

jellylobster | 2022-01-23 23:31