14 lines
432 B
GDScript
14 lines
432 B
GDScript
extends PathFollow2D
|
|
|
|
@export var speed = 0.1
|
|
var voiture
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
voiture = (self.get_child(0) as Voiture)
|
|
voiture.updatePosition(position.x, position.y)
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
progress_ratio += delta * speed;
|
|
voiture.updatePosition(position.x, position.y)
|