23 lines
634 B
GDScript
23 lines
634 B
GDScript
extends Node2D
|
|
|
|
@export var this_seg : Node2D
|
|
@export var prev_seg : Node2D
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
pass # Replace with function body.
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
if this_seg and prev_seg:
|
|
show() # would also need to enable/disable
|
|
look_at(prev_seg.position)
|
|
#position = curve.get_closest_point(lerp(this_seg.position,prev_seg.position,0.5))
|
|
|
|
#global_position = lerp(this_seg.global_position,next_seg.global_position,0.5)
|
|
else:
|
|
hide()
|
|
|
|
|
|
# rotate arm towards next seg
|