- Home /
How to detect empty slot and spawn gameobject there?
Good day,
i have a 4x4 grid of circles in my game, and throughout the course of gameplay any random circle in the grid can be destroyed. I would like to detect the area the which is empty after 2 seconds and then instantiate another circle in the exact spot. Can someone help me with this?
i have added a few images to help explain what i mean.
Answer by theLucre · Nov 30, 2014 at 02:14 AM
is your grid stored in a data structure? typically you'd use a list or two-dimensional array to hold references to those gameobject/scripts. Then when one is removed, you know where on the grid it was originally and you can instantiate a new one and update the reference to that grid coordinate.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Instantiate as child 3 Answers
Split a cube into several pieces? 1 Answer