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()