static body input doesn't seem to work in instanced scene

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

hello guys,
I am having a little problem. I want to detect when a click happens on a mesh with a static body and a collisionshape. When I play the scene, it works perfectly, but when the scene is instanced in the main game scene, I cannot detect inputs on the instanced staticbodies.
the crude code looks like this :

func _on_StaticBody_input_event(camera, event, position, normal, shape_idx):
	print("mouse entered")
	if Input.is_action_just_pressed("ui_left_click"):
		print("mouse click")

the scene tree looks roughly like this :

Game
-BuildMeshes
–Buildings
— (The instanced scenes goes there)

and the instance scene goes like this :
-MeshInstance
–StaticBody (where the script is attached)
—CollisionShape

Any idea ? thanks a lot

update to this question : In godot 4 it seem that I can trigger the collision when I use my mouse wheel zoom function. If I click and at the same time zoom or de-zoom, the collision shape functions gets triggered

Anate | 2023-02-08 20:00