Problematic Path2D updating points for each new instance

Godot Version

4.3

Question

How would I separate the points of a Path2D within a scene from another instance of that scene?

I’m having some trouble with Path2D nodes updating their points every time another Path2D enters the scene tree. This affects the child nodes (pathfollow2d with their own sprite2d child) by either relocating them to the adjusted progress value (and therefore a new global position) of their pathfollow2d because of the extended Path2D, or placing every instantiated child (pathfollow2d with their own sprite2d child) in a continuously updating path.

To make a fair point of this, my intentions are to create a new path for a sprite to follow with points that are generated by code. When the sprite reaches the end of the path, it is removed. The new path would happen at random.

Think of the classic ship shooters where the waves of enemies follow along a path single file with some curves around the screen. In those days the movement was restricted. For my purposes, I’d like it to be more randomized.

This is the simplest way to explain it:

You’ve got a Node2D as your main scene with a timer node. On the timeout signal, a new Path2D scene is instantiated. The script looks like this:

extends Node2D

func _ready():
    pass

func _on_timer_timeout():
    var new_path_2d = preload("res://path_2d.tscn").instantiate()
    add_child(new_path_2d)

The scene new_path_2d has a Node2D as the root, with a Path2D as a child. The points are generated randomly. Here, I’ve done it the same way with two different looks. The points generated by point_range and random_number do the same thing.

This scene also instantiates a child scene, which will later be a for loop on a count for the number of enemies at a time interval of release.

In a different version I found duplicating a local pathfollow2d by a random count, adding those to an array, then using a for loop to give them sprites doesn’t fix the Path2D problem.

The script for the new_path_2d scene:

extends Node2D

@onready var path = $Path2D

func _ready():
	var point_range = Vector2(randf_range(0,1000), randf_range(0,1000))
	var random_number = randf_range(0,1000)
	path.curve.add_point(Vector2(random_number, randomo_number))
	path.curve.add_point(point_range)
	
	var path_follower = preload("res://path_follower.tscn").instantiate()
	path.add_child(path_follower)

The path_follower scene is simple. A pathfollow2d node as the root with a sprite2d child. The pathfollow2d node has rotates and loop properties disabled. Disabling cubic_interp does not change the issue. The script:

extends PathFollow2D

func _ready():
	pass

func _process(delta):
	progress += 100 * delta

In the end, the main scene runs and the timer instantiates a line with random points. The sprite begins to move and the timer hits again, the path2d is extended and another sprite starts where the first began. The sprites will continue indefinitely.

So, what am I missing? I’d like to create separate paths for each sprite where the pathfollow2d progress only follows that particular instance. Is this possible?

I appreciate your help, friend.