Destroy Building in Unity3D

Hello Unity3D i have a question about buildings.How can i make it that when my character hits a building with enough force they can destroy a building and the building gets destroyed in a smooth manner without having to use blender to animated it.If it is possible to do such a thing in unity3D.Can someone please tell how this could be done?

P.S Heres an example

You can achieve this through long amounts of learning the fundamentals of programming. I’m not going to provide you with a ‘plug n play’ solution. What you may what to do is look into mesh deformation, or you may want to model separate pieces for the building in the 3D modelling program of choice.

There are also many assets on the asset store you may use :
https://www.assetstore.unity3d.com/en/#!/search/destructible meshes

As for if Unity can do it, it doesn’t provide a drag and drop if that’s what you are asking. The only limitations are what you are willing to learn and apply within Unity.

EDIT :
Another thing you could do, (Which I am assuming is what they are doing in the video) is create each piece as a rigidbody that is set to not fall. Then when collided with, check the velocity of the interacting object and if it is above a certain threshold, turn the gravity on. (However this is possibly the least efficient way in large numbers)

“I’m not going to provide you with a ‘plug and play’ solution”, replies like this make programmers seem self centered and caustic, remember you had to learn once upon a time.

2 Likes

OK you need two models, one solid one pre-broken*. When your character/game applies enough force the breakable model is swapped in and the physics engine takes over.

  • This reduced graphics and physics load when your game is not breaking buildings.

You can also in Unity run a physics simulation of part of a building breaking, record it as an animation and play it back when your game breaks a building. Not as dynamic but could be useful to reduce processing load if your character/game can break distant buildings e.g. LOD’ing the damage/destruction.

You necroed a thread from four goddamn years ago to shit on a piece of helpful advice that pointed the OP in the right direction.

Ironically the people who often make the statement you made are the ones who seem to provide the least assistance. A quick check through your posts shows very little since you have almost no presence here, but a check through @Myhijim 's posts, especially the ones in the Scripting section, show that he has provided extensive assistance.

You’re free to provide a solution of your own if you wish or better yet provide some helpful assistance towards learning how to implement a system of this nature. After all getting handed code for free doesn’t teach you anything, but getting help and having questions answered does. From the way the OP’s post reads he was asking for advice not a handout.

If you really want to do your best, and learn the most, don’t waste any time fussing over somebody’s method of communication. So what, you got your feelings hurt? Nobody cares, and so long as you do, you aren’t doing yourself any good at all.

If there was something useful said, use it. If not, carry on.

There are two common approaches: (a) fracture the mesh within a modeller, and (b) fracture the mesh in Unity. Learning resources for the first method are very common but resources for the second exist almost entirely as code you need to read and learn from as the technique isn’t trivial.

Here is one of the more recent (April 2017) tutorials for the first method.

https://www.youtube.com/watch?v=xqQkiHI5U9o

Here is one of the more recent (Unity 2017.2) code samples for the second method.

https://github.com/DavidArayan/EzySlice

3 Likes

Please explain the helpful advice? This type of crap attitude is why developers get a bad name, it’s not our fault your parents didn’t give you the skateboard you wanted when you were 10 years old, so leave their basement already. And yes I do hire people, and if they fail to demonstrate empathy for newbies, they will not be working for me.

You are trying to reason with a person who has never asked for help, who is all knowing and a virtual walking Google, just ask him. This board will quickly sink into Stack overlflow before you know it.

Truthfully the post was aimed at you. You speak of people being self-centered, being caustic, make the claim that Unity’s forums are progressing towards the mentality found at Stack Overflow, etc but you’ve been with us now for four years and you have yet to provide any assistance yourself whereas everyone else in this thread has done so many many times.

What sinks forums is personal attacks (not allowed), and demanding that other people do your work for you. We’ve quite literally had members called “lazy” for not spending their time writing free code on the forums, in a frankly breathtaking display of entitlement. That sort of toxic attitude isn’t welcome here, and that goes for necroing threads only to berate people while adding nothing.

–Eric