Hey guise, I have this problem where I have a unit array with 5 slots. Every 1 second I want to create a unit and place it in a free slot in the array. This is all fine and good, but the problem arises when the array is full. What I want to do then is kill unit number [1], and make unit number [2] take its spot, and make unit number [3] take number [2]'s spot and so on and so on. I can't figure out quite how to do this. The code I've used so far looks like this:
Hey guise, I have this problem where I have a unit array with 5 slots. Every 1 second I want to create a unit and place it in a free slot in the array. This is all fine and good, but the problem arises when the array is full. What I want to do then is kill unit number [1], and make unit number [2] take its spot, and make unit number [3] take number [2]'s spot and so on and so on. I can't figure out quite how to do this. The code I've used so far looks like this:
The problem is obvious; I'm setting Unit[5] to two different units, but I can't think of any other way to do this. Please enlighten me :)
Kill Array[1]
Array[1] = Array[2]
Array[2] = Array[3]
Array[3] = Array[4]
Array[4] = Array[5]
Array[5] = My New Unit
tyty alot. worked. knew it was simple :D