Destroyable Buildings v3

Hi folks,
Maybe you remember my old “destroyable buildings” project, the one of the collapsing tower and version 2, which is more adapted for breaking pieces out of a larger object…
Yesterday I started reworking the whole project, I took the tower from version 1 and improved it a bit, I rewrote the complex, 3 pages long script from version 2 and here it is: Destroyable Buildings v3 :slight_smile:

The whole code is only a few lines long, but it’s better than all the previous versions. You can simply set what objects automatically collapse when one object is hit, you can set single breakforces for every single object in scene and the objects can break into pieces or replaced by some other object.
I’ll keep working on this, maybe I’m gonna add some new features too, like some auto-setup thing or let the pieces be inflamable and sensitive to normal raycasting too (that got kinda lost in version 2 3)…

If you have any more suggestions to make or cool ideas for the next version, just post them here.

-version 1:
http://forum.unity3d.com/threads/9411-Destroyable-buildings?highlight=destroyable+buildings
-video from version 1:

-version 2:
http://forum.unity3d.com/threads/17077-Destructable-buildings-gt-New-version-available!?highlight=destructable+buildings

406263–14018–$Destroyable Buildings v3.unitypackage (1.51 MB)

Excellent! Now i’m just gonna use this in my game. And of course give credit to you.

I’m glad you like it! I’m just adding SendMessage damage and making them flamable, when it’s ready, I’m gonna upload this too…

Very very thanks :wink:

not bad

cloud you make a version with modern building like skyscrapper or smth like country house?

Okay, I’m trying, but I’ll have to reuse some elements from version 2 (which was better for modern architecture). I guess writing several unique scripts for different uses would be a good thing.
For the moment, the newest version includes flamable pieces, static-to-dynamic switch and hitpoints. I think you don’t even need joints anymore, just put rigidbody on your pieces and I’ll rework that in my code. A master-code to automatically add rigidbody and adjust correct weight for every single piece will come too. This could save you some of your time, plus I could add some elements to reduce performance cost and maybe I’ll have to put in collision sounds, etc…

If you have any more useful ideas, please tell me!:slight_smile:

(ps: Wow, I’m thinking of some kind of in-editor level generator, but which lets you destroy every single structure of the game, no matter if it’s a wall, a tower or any other building :shock: Now, THAT would be awesome)
(ps2: Okay, I’ll just focus on improviing destroyable buildings first)

Thanks

Any specific reason there isn’t a webplayer?

Well, the reason is that I didn’t make one yet :wink:
But you can just download the .unitypackage and try it out yourself… The whole package is only 2 Mb, so that I don’t see a real problem in downloading it…

there is no problem in downloading, but for the future please make webplayer version, you will get feedback a way faster

Am… How use it?

thanks men
hey would you be interest in doing some
destryable cars and spaceships?
i need them for my game
ill give you credits
and if you want
profits of the game
:smile:
att.: rudak

Well, just put together a construction, tower or whatever you want, add rigidbody to the pieces and attach the included script to every single piece. The script is quite easy to use: if you want the pieces to be flamable, just put some fire particle effect into the “flames” variable, if it should be replaced by smaller pieces, assign your prefab as “broken”. “maxForce” indicates how heavy a collision must be to let this piece collapse. hitPoints regulate how long something burns and how much regular damage it can take before collapsing/breaking apart.
“connectedTo” is the most important variable, it indicates which other breakable parts (who have the same script attached to them) are connected to this object and who’s stability is therefore depending on the selected object. If you break this piece, which other pieces should collapse as a reaction to this…

Sorry, I didn’t work on it in the last 2 weeks… But with only a few little changes, this could easily be done. For example by deleting the thing with rigidbody and joints and adding rigidbody and colliders only after the impact…

can u upload the file again with the scripts plz as game front isent working

Your work remind me of blast corps for the N64 lol fun game :slight_smile:

Hi, sorry for the late reply, but I honestly completely forgot about this project lately :stuck_out_tongue:
I think I’ll just rewrite all of the codes, 'cause version 3 is kind of a mess. Too many scripts and much to difficult setup, etc…

I’ll post everything here, once I’m done.

NEWS:

New version available! I just finished the fourth version of my destroyable buildings project, so here’s the link to the thread:

Download link