- extends Node2D
- func _ready():
- if $Line2D.get_point_count() == 2:
- $RayCast2D.position = $Line2D.get_point_position(0)
- $RayCast2D.set_cast_to($Line2D.get_point_position(1))
-
- else:
- print("Line2D has more than 2 points. Will not work")
-
- func _physics_process(delta):
- if $RayCast2D.get_collider():
- $RayCast2D.get_collider().queue_free()
|