18 lines
345 B
GDScript3
Raw Normal View History

2019-09-16 02:07:41 -04:00
extends Line2D
var target
var point
2023-02-01 04:43:50 -05:00
@export var targetPath: NodePath
@export var trailLength = 0
2019-09-16 02:07:41 -04:00
func _ready():
target = get_node(targetPath)
2023-02-01 04:43:50 -05:00
func _process(_delta: float) -> void:
2019-09-16 02:07:41 -04:00
global_position = Vector2(0,0)
global_rotation = 0
point = target.global_position
add_point(point)
while get_point_count() > trailLength:
2023-02-01 04:43:50 -05:00
remove_point(0)