Here is a line of code that I used inside the void Update() function to make clones of the UI Image “car”.
Image c = Instantiate (car, carPos, transform.rotation, transform.parent) as Image;
How do I store all the clones to an array and destroy the first one, every time I press a button?
If i use…
Destroy(c);only the clone instantiated at that moment would be destroyed. But I want only the first clone to get destroyed. (each time I press the button)
Please help me fix this. Thanks in advance.