FantasyRun/Tiles/tile_path.gd

27 lines
468 B
GDScript3
Raw Permalink Normal View History

extends Path3D
class_name TilePath
@onready var follow: PathFollow3D = $Follow as PathFollow3D
var _marker: Marker3D
var marker: Marker3D:
get:
if not has_progress_marker():
create_marker()
return _marker
func has_progress_marker() -> bool:
return _marker != null
func create_marker() -> Marker3D:
_marker = Marker3D.new()
follow.add_child(_marker)
return _marker
func receive_marker(node: Marker3D) -> void:
node.reparent(follow)
_marker = node