Need help with random object spawning, they keep spawning in same place

I believe the whole method can be simplified to:

One thing you could add is a bounds check for that array, so we don’t Get a transform that does not exist.