add projectile destruction and elevation

This commit is contained in:
2025-02-27 22:47:08 +10:00
parent a4d6a3eb81
commit 85ee6da79d
6 changed files with 38 additions and 9 deletions

View File

@@ -18,7 +18,6 @@ func _ready() -> void:
_life_timer = _lifetime
_debug_collision_shapes.init(get_children(), self, _collision_debug_material)
global_position = _start_position
global_position.y = HEIGHT
body_entered.connect(_on_body_entered)
@@ -42,7 +41,19 @@ func set_velocity(velocity: Vector3) -> void:
func _on_body_entered(node: Node3D) -> void:
if node is not Player:
if node is Player:
queue_free()
return
queue_free()
print(node)
if node is CollisionObject3D:
var collision_node := node as CollisionObject3D
if collision_node.collision_layer & 1:
queue_free()
return
if node is CSGCombiner3D:
var collision_node := node as CSGCombiner3D
if collision_node.collision_layer & 1:
queue_free()
return