- Home /
Break 3D Object into Pieces
I want to break my enemy object when it gets hit by tank missile.
I found a reference for the similar effect that I am looking for:
Battle Disc Gameplay
In the above game reference, they are destroying obstacles with similar effects that I want to implement.
All the wall obstacles get converted into small pieces.
How to implement something similar?
I can't able to understand where to start to achieve something similar so please guide me :)
Answer by Lightning_A · Nov 14, 2019 at 01:05 AM
This is probably roughly what you're looking for
You'll probably want to create a cracked version of your model in your 3D modeling software of choice. This video doesn't cover specifically cover how to split up the 3D models, but there's probably many other videos that can.
Answer by lgarczyn · Nov 14, 2019 at 03:13 AM
There are four different ways to do this:
every mesh is replaced of many "broken" parts, that form the complete mesh together, and that are turned into rigidbodies when they are separated. For performance concerns, the mesh can be replaced by the multiple broken parts only when the mesh actually "explodes".
a particle shader is created from meshes that look like parts of the main mesh, and an effect is used to hide the transition between solid mesh and broken pieces
the mesh is dynamically and procedurally cut into many smaller parts
the mesh is duplicated many times, and a stencil shader is used to make it look like it every clone is only a part of the mesh
1 is easy to implement, and probably what you want. 2 is easier, but might not look as good. 3 is the hardest to implement, but there are packages to do that. 4 is a terrible idea, unless you want to optimize your game for draw passes or some very specific need.