Aug
2
2013

Poor man’s Mesh Exploder

poor_mans_mesh_exploder_unity_1

Always wanted to try making exploding meshes, finally had time for a small test version..

Info
– Shortcut to easy mesh (fake) destruction: Take each face, Create small 3D mesh piece for it (extrude/add vertice(s) backwards from face normal), Add rigidbody, Done!
– Used this code for slowly fading out the sleeping rigidbody pieces

TODO:
– Add some randomness to piece sizes/count? (now it gets slow if you explode the default sphere..too many faces)
– Add tangents, so can use normal maps (UV’s are already taken from source object)
– Add some option or fixed mat/color(?) for UV mapping the cut side..
– Adjust extrude size calculation (so that you could automatically split the already broken pieces..but not enough faces?, so just explode it to particles..)
– Make some building or wall to explode? (but must be invidual pieces..and gets difficult if should remove parts from original mesh instead)
– Add explosion force to hit position?

Webplayer:
http://unitycoder.com/upload/demos/MeshExploderUnity/

// now free at: (link coming soon)

– Same as demoscene, just not all the textures are included
– Not much comments or instructions..see demo scene how it works
– Warning! It will not work well with different shapes!! Default cubes are best (or low poly sphere, not the default unity sphere)
– Sample sphere fbx model included (as in demo scene)
– UV mapping is not perfect on the exploded piece back side..
– at line 80: float extrudeSize is the mesh piece size which is created
– Download link arrives to your email automatically

Image#2: Using cubes
poor_mans_mesh_exploder_cubes_unity_1<-click to view


Related Posts

About the Author:

.fi

17 Comments + Add Comment

Leave a comment

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch Instagram

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.