KinematicBody2D event not triggered when collide other object

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By nathoenk
     func render_content_inventory():
       	for slot in slots:
    		if (Inventory.get_data(slot.index)):
    			var kinematic_body =
    			var collision = render_collision_shape(
    				{'x': 0 - style.width_2 * 0.8 / 2, 'y': 0},
    				{'width': style.width_2 * 0.8, 'height': style.height_4 * 0.8}
    		if $window_inventory.get_node('kinematic_item_slot_'+str(slot.index)):

func on_input_event(viewport, event, shape_idx):
	print('hover in')
	if event is InputEventMouseButton:
		if event.button_index == BUTTON_LEFT and event.pressed:
		elif event.button_index == BUTTON_LEFT and !event.pressed:
	elif event is InputEventScreenTouch:
		if event.pressed and event.get_index() == 0:
			self.position = event.get_position()

its only trigger when I hover outside PopupDialog

Your KinematicBody2D has a collisionobject2d (the blue thing), right? I’m not sure what’s going on exactly, but it needs to collide with another CollisionObject2d for an event to trigger or physics to simulate. And from what I see in the image, there is no 2nd CollisionObject2d to collide with.

TheJokingJack | 2021-04-12 20:25