Endless spawing platform spawns too many and too far apart. Help with code please?

Hi, I’m making endless tunnel runner and I wrote some code to spawn 10 environment/tunnel prefabs which are destroyed after 3 seconds the player steps off them. However, when I run the game, too many prefabs are spawned and they are spaced out after the first 10, resulting in the player character falling off. I’m designing the game so that the player stays in the same spot and environment comes towards them. I am learning coding so I appologise if it is messy.
I’ve attached the code below.
Thanks in advance.

I don’t know why a lot are spawning at the start, however, they are spaced out because you are setting the spawn position of a platform, waiting till one is destroyed, and then spawning another one at the same spot, by which time the other platforms will have moved away.