Add trail component for homing bullets; update homing bullet scene and remove debug print

This commit is contained in:
2025-05-13 01:36:56 +02:00
parent b96046d983
commit 907bb5226f
4 changed files with 37 additions and 3 deletions

View File

@@ -47,7 +47,6 @@ func _physics_process(delta: float) -> void:
func on_detection_area_body_entered(body: Node) -> void:
print("Body entered detection area: ", body.name)
if target != null:
return

View File

@@ -0,0 +1,18 @@
class_name TrailComponent
extends Line2D
@export var max_points: int = 100
var queue: Array[Vector2] = []
func _process(_delta: float) -> void:
queue.push_front(owner.global_position)
if queue.size() > max_points:
queue.pop_back()
clear_points()
for point in queue:
add_point(point)

View File

@@ -0,0 +1 @@
uid://c0bvan0swashx