Multiple Balls

I tried using multiple balls but there is an issue where sometimes a block gets registered as destroyed 2 or more times. I am guessing from multiple balls hitting it at the same time. This increases the blocks destroyed count variable, causing the level to end before all the blocks are really destroyed.

What is the best way to handle simultaneous collisions on a single object from multiple objects? Will this be covered in a later video?

Hi,

You could solve that with a flag. Create a bool at the top of your Block script instance, name it isDead or something like that. Set it to true when the block is destroyed for the first time. Use that bool in an if-statement to determine whether the block can be destroyed or not.

Did this help?

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms