destroying instantiated prefab loaded to 2D list
i am having trouble with destroying a row of bricks that gets spawned when a certain action takes place. I saved the brick instantiated prefabs into a 2D list and now i can't seem to destroy the prefabs through it using a trigger. Could anyone suggest a fix for this method or an alternative to perform this function?
i have attached below the error and this is the script
ArgumentOutOfRangeException: Argument is out of range. Parameter name: index System.Collections.Generic.List`1[UnityEngine.GameObject].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633) brickManager.destroyRow () (at Assets/Scripts/brickManager.cs:129) brickManager.Update () (at Assets/Scripts/brickManager.cs:47)
Your answer
Follow this Question
Related Questions
My weapon switching script is not working? 1 Answer
Enemy Spawner Help 0 Answers
Objects getting destroyed in unity test, but only sometimes in the phone app 0 Answers
How to save game objects and switch out unsaved game objects via code. 0 Answers
Spawning a projectile in front of a player based on player rotation 1 Answer