2023-09-01 13:48:48 +02:00
|
|
|
extends Path3D
|
|
|
|
|
|
|
|
# Reference to the PathFollow node
|
|
|
|
@onready var path_follow = $PathFollow3D
|
2023-10-05 13:57:25 +02:00
|
|
|
@onready var path_follow =
|
2023-09-01 13:48:48 +02:00
|
|
|
|
|
|
|
# Speed of the movement along the path
|
2023-10-05 13:57:25 +02:00
|
|
|
var speed = 0.8
|
|
|
|
|
2023-09-01 13:48:48 +02:00
|
|
|
|
|
|
|
func _process(delta):
|
|
|
|
# Update the offset to move the object along the path
|
|
|
|
path_follow.progress += speed * delta
|
|
|
|
|
|
|
|
# Loop back to the start if we've reached the end of the path
|
2023-10-05 13:57:25 +02:00
|
|
|
if path_follow.progress >= 18.81:
|
2023-09-01 13:48:48 +02:00
|
|
|
path_follow.progress = 0.0
|