Move objects infinite based on distance and not an invoke

So I kind of hit a wall with my logic and I need some help trying to flesh out this idea.

Currently I have an invoke that gets an object from an object pool and basically spawns it every second and it moves automatically. What I found is that when you increase the speed of the object, the distance between the objects spawning is increased, which is not the desired result. What needs to happens it that the distance between the spawned objects will remain the same no matter the speed of the objects, it will always spawn 10 units away from the next.

Clearly this bit of code is just terrible and is not at all reusable and only works once through.

    void Start()
    {
            obj1 = GetPooledObject(); // get an inactive object
            obj1.SetActive(true); //set that inactive object to active. This begins object movement
    }
    
    void Update()
    {
        distance = Vector2.Distance(obj1.transform.position, transform.position); //calculate distance between this object and objectpool start position
            
        if (distance > 10 && !secondObject)
        {
            MoveSecondObj();
        }
    }
    
    private void MoveSecondObj()
        {
            var obj2 = GetPooledObject();
            obj2.SetActive(true);
            secondObject = true;
        }
`
`

Essentially you are describing a wave. The nature of waves is that speed = frequency * wavelength. If you increase speed you have to decrease frequency to get the same wavelength. In other words call your spawn function more often.

Invoke repeating is not well suited for this, use a coroutine or a custom timer instead.

If you dont need to use the obj1 for anything more than spawning procedure, you can use it to store the reference of your last spawned object. Than In Update you check its distance to the spawner (Transform.position) if its bigger than 10, you spawn another object and put its reference to obj1. This is simple code that could do that ( I assume that GetPooledObject() returns Transform type. )

Transform obj1;
void Start()
    {
       SpawnNextObject();
    }
    
    void Update()
    {
        distance = Vector2.Distance(obj1.transform.position, transform.position); //calculate distance between this object and objectpool start position
            
        if (distance > 10)
        {
            SpawnNextObject();
        }
    }
  
    void SpawnNextObject()
    {
            obj1 = GetPooledObject(); // get an inactive object
            obj1.SetActive(true); //set that inactive object to active. This begins object movement

    }