In Godot 4, offset
changed to progress
. So your code can be:
@onready var _follow :PathFollow2D = get_parent()
var _speed :float = 120.0
func _physics_process(delta):
_follow.set_progress(_follow.get_progress() + _speed * delta)
If you want to go with Tweens (which is better), you'll want to use that way:
@onready var _follow :PathFollow2D = get_parent()
func _ready():
_follow.progress_ratio = 0
var tween :Tween = create_tween().set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN_OUT)
tween.tween_property(_follow, 'progress_ratio', 1, 1)