Destruction (417353)

Hi there

I’ve been thinking how I could achieve some sort of “fake” destructible environments in my Zombie FPS game, since Unity doesn’t have proper physic destruction systems integrated (yet :wink:).
I did come up with this cheap way which turns out to work just fine, nothing too exciting but it does the job of “faking” destruction :stuck_out_tongue:

It’s very late here, so I quickly built a rough scene partially using this method. It’s very basic and yes the box glitches at the end, I only noticed it after uploading the files to dropbox :sweat_smile:

Here’s the webplayer build: https://dl.dropbox.com/u/8750659/destruction.html

Well you get the idea though.
The way I’ve done it was with a help of Autodesk Maya. There is a cool feature in Maya called “Shatter effect” under Dynamics shelf, which allows you to shatter any mesh into random size pieces. You are able to define the amount of pieces the mesh will be shattered to etc. and it doesn’t deform the mesh, just shatters it neatly which is just brilliant.

In this small demo, I’ve shattered one box into 8 pieces and the very top one into 20 pieces. The pieces are grouped together, so they don’t just fall off but stay together like as if it was a normal mesh.
How ever, each piece has a mesh collider as well as rigidbody attached to it, which creates the effect of destruction upon collision.

Honestly there is nothing too cool in that demo, but I’ll try to make something more advanced in real time “fake” environmental destruction using this method tomorrow.

What do you guys think?
(sorry if this has been discussed before, haven’t really seen many topics on destruction here)

Thanks and good night :wink:

This is actually a very cool way to do semi-dynamic destruction. It’s not as good as the real thing, but should definitely work just as well in pretty much all cases. One suggestion, though: to boost performance the cubes should be the normal ones without the shattered pieces, but turn them into the shattered one when then collide.

Neato maleato. This is fantastic.

That’s really good. You could also add a script for something like health to each section, so that you could build stuff like barriers with it, and destroy sections at a time based on the health, or velocity of the object itself.

Looks great though. Oh, it would also benefit the appearance of it to add particles of dust when it explodes. Maybe somehow attach the particle emitter to different sections of the broken parts.

Just a suggestion. (It’d be cool if there were some way to automate the process of adding in all of the stuff I mentioned XD)

Thanks
I’ll try to do something more advanced with health points and destruction particle effects today :smile:

Simple and effective, nice work :slight_smile:

Your method is actually pretty similar to how other engines (such as Unreal 3) do the same effect

Yup. I know that they create the shattered mesh, but they also use some other way for real time destructions. I assume they somehow make it so when e.g. the mesh is hit by a bullet, it detects where the collision took place and affects mainly the piece of that shattered mesh which was hit according the the strength of the impact instead of destroying the entire mesh at one go.

I read somewhere that they connect the pieces of mesh with joints and upon collision the joints around the piece of mesh which was hit are destructed or something…

ehh idk >.<