I cant get an enemy to queue free when hit by a ball

Godot Version

` 4.3

Question

hello
Im trying to make a small game that like space invaders mixed with pong
but when the enemy gets hits by a ball it wont queue free
ive tested it with other object and it works just find but with the ball it dosent work at all even it i make them directly intersect
here is the ball script

extends CharacterBody2D
@export var speed = 200



func _ready() -> void:
	velocity = Vector2(0,-100).normalized()*speed




func _physics_process(delta: float) -> void:
	var collision = move_and_collide(velocity*delta)
	
	if collision : velocity = velocity.bounce(collision.get_normal()) 


and here is the enemy script

extends CharacterBody2D
func _physics_process(delta: float) -> void:
	var collision = move_and_collide(velocity*delta)
	if collision : queue_free()

as a bandage fix i put a very slightly bigger character body 2d over my balls character body 2d witch seems to make the enemy
queue free like i wanted while also allowing the ball to bounce

1 Like