The distance along the path, in pixels. Changing this value sets this node’s position to a point within the path.
play around with it in the inspector, slide the progress number left and right and watch it change the position.
As for code changes I think this is what it would look like; I’ve removed the duplicated code between if statements. I think you wanted the sprite to not go over the path length, but that can be achieved by disabling loop on the PathFollow2D
@onready var path_follow: PathFollow2D = $NavigationAgent2D/Path2D/PathFollow2D
func move() -> void:
var targetpos = path_follow.progress + step
var tween = create_tween()
tween.tween_property(path_follow, "progress", targetpos, speed)
checkwin()
I do not see how speed is defined but the tween’s fourth argument should be calculated as duration step / speed for consistent looking movement. Last thing is checkwin might want to wait for the tween to finish, you can use this line to do just that.