Question about signal [Solved]

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

Hello, simple question about signal. I connecting signal but it is not emiting, cant find why. here is code:

extends KinematicBody2D

func _ready():
entities = get_tree().get_nodes_in_group('entity')
	
for e in entities:
	e.connect('mouse_entered', self, '_mouse_on_entity', [e])
	e.connect('mouse_exited', self, '_mouse_off_entity', [e])
	
	print(e.is_connected('mouse_entered', self, '_mouse_on_entity'))

func _mouse_on_entity(body):
    print(body.my_name)

is_connecting prints out true but signal not emiting (entity is a kinematic body and Pickable set to true). Please help
Thank you

Edit: For some reason parallax node was blocking signal.

I assume the kinematic bodies have an assigned shape and collision layer, correct? Perhaps some other object that sits on top of them (even if transparent) obscures them to mouse events?

skysphr | 2022-03-27 14:08

collision shape and layers is correct and no other object is blocking them. I have some Panels on the scene as well (I try to set mouse filter but no luck).

swipis | 2022-03-27 15:29

Removed parallax node from tree and signal working.

swipis | 2022-03-27 16:53