Scripts randomly getting disabled
A 2D game I'm currently working on is similar to Tetris, I have prefabs which are premade shapes of blocks , those blocks are children of a empty gameobject and those blocks have an attached script and a 2D box collider. When the prefab is 'placed' it disowns all of it's children and deletes itself.
When the individual blocks should disappear (think completing a row in Tetris) their script runs
GameObject.Destroy (this.gameObject)
99% of the time this works absolutely fine. The rest of the time the transform stays with the script and box collider disabled, other blocks can move through them and they never disappear.
What is causing this issue? How can I fix it? Either a more reliable way of removing themselves or a way to stop the script ever being disabled (unless the gameobject is destroyed)
Your answer
Follow this Question
Related Questions
Camera Switch Error 2 Answers
Bug With 2D Gun 0 Answers
How do you assign multiple prefabs to a prefab brush? 0 Answers
UI Builder scripts not working after restarting Unity 0 Answers