inputting signals not working

Godot Version

`4.3’

Question

So basically i use a _on_click_signal_input_event() function to detect whether the mouse was clicking on an object3d or not, and after i left-click on the object, it should be removed. However, this does not work as expected and the object isn’t picking up my clicks. Could anyone help

extends RigidBody3D
@onready var ball = $“SphereBody/Sphere Body”
@onready var particle = $SphereBody/GPUParticles3D
@onready var sfx = $SphereBody/AudioStreamPlayer3D
@onready var collisionbody3d = $SphereBody/CollisionShapeSphere

func _ready():
Level.objectcount += 1

func _on_click_signal_input_event(camera: Node, event: InputEvent, event_position: Vector3, normal: Vector3, shape_idx: int) → void:
if InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT && event.pressed:
queue_free()

How is your scene tree set up? This script extends a RigidBody but has another body as a child? Where does the click signal come from? Can you screenshot your scene tree for us?

Your if InputEventMouseButton: should be check if the event is that type

if event is InputEventMouseButton:

make sure to format code pastes properly