door between segements are placed and rotated correctly :3
This commit is contained in:
parent
1c0fbf3d69
commit
5197d10172
7 changed files with 96 additions and 2 deletions
23
prefabs/door.gd
Normal file
23
prefabs/door.gd
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue