I decided to dedicate this week into looking into how items in the environment could be made destructible and/or interactive. So I started researching how I could make this effect through blender and import it into Unity for use inside of the game.
Through research on the Blender forums, as well as YouTube, I learnt of a Blender addon named Cell Fracture, that randomly fractures the mesh through a noise modifier, which allows me to have both a whole model, as well as a fractured model, which, when switched between fast, makes it seem that the mesh fractured when touched/attacked.
I used this through the base enemy orb I created, as well as a door model that I made, so that the door could be destroyed by using explosives or charging into it at full speed. This gave the game a good feel, as debris scatters when it explodes.


The doors are using random colours in this view to represent each individual mesh.
Each of the individual pieces has their own rigidbody and collider, allowing them to act on their own, for a sort of random debris scatter when the door breaks in the game. I like this as it makes the game feel more fluid and real, as a door would typically break if hit with explosives.

This is the code that detects if an explosive, or the player has collided with the door, instancing the destroyed door in the same position as the original door, and removing said unbroken door.
Tagging it to an open tag named “Explosive” also allows me to automatically have the door interact the same way with any other explosives, so long as I tag them with the Explosive tag.

