Kill zone not working?

Godot Version

4.4.dev7.official

Question

Im still new here, trying to code a pong-like breakout game as a way to learn the engine, but i cannot get the ball to get deleted when touching the kill zone. Here’s what I have in the Kill zone script:


extends Area2D

func _on_body_entered(body: Node2D) -> void:
	print("hello")
	if body is RigidBody2D:
		body.queue_free()  # Deletes the RigidBody2D node

The print hello doesnt get called , and neither does the queue_free. the ball is definitely touching the area 2d:


Please help if possible.

Are you sure the signal is connected? Could you show your scene tree? If it is did you edit the collision layers or mask?

Not at home right now, but I did do all of that
Signal is connected (I tried disconnecting and reconnecting multiple times)
All collision nodes have the same mask and layer as of right now.

I did not have them on the right mask/layer. Fixed now lol

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.