- Home /
The question is answered, right answer was accepted
how would you make a destructible cover
In many games lately I've seen destructible surfaces that help a lot to make maps more dynamic by blowing up cover or opening path's, i was wondering what possible ways are there to make destructible surfaces in unity? All your help is much appreciated and i thank you all for taking your time to view this question.
p.s. I want to make clear I am not asking you to write code, I am only looking for ideas, if you want to put an example to make your ideas clearer it's up to you.
Answer by Firedan1176 · Jul 03, 2014 at 03:54 PM
There are different ways to do this, which include:
Use a separate 3D animation program (Blender for example) to destroy a 'barricade/barrier' and save the dynamic into a keyframed .fbx file. Then, you can import this model with animtions (the destruction) into Unity and create a cube without a mesh renderer to act as the true and real barrier. Then, you can play the destruction animation, and after the animation is done, you can disable the box collider on the invisible cube that acts as your true barrier. Then the player can enter.
You can import a series of broken pieces into Unity and give each one a mesh collider (according to the shape of the piece) and rigidbodies with isKinematic to true. When you want the wall to fall, you can disable isKinematic to make the wall fall (Alternatively you can use another object with velocity to crash into the 'wall' and push the pieces around to look like an explosion).
I hope I've provided you with options and thoughts to what possibilities you could use. There are many other ways to do so too.
(I apologize if there are any errors in my examples.)
thanks Firedan1176, your ideas are really helpfull, i will sure give it a shot.
Answer by Ricewind1 · Jul 03, 2014 at 03:43 PM
Use a separate gameObject, prefab, model or whatever you like to call it for your cover. Give it a collider and use a collision function/method in it's script.
You can then say that it gets destroyed after an amount of damage (working with hit points), an amount of hits, or just having it destroyed after one hit.
Wait some time before destroying the gameobject. Use this waiting time to have sounds play, particles play, or other effects (like having chunks of the material fly off).
thanks a lot Ricewind1l, i realy apreciate you taking your time to answer my question. it has been really helpful.
Follow this Question
Related Questions
Looking for an asset that allows me to edit terrain in real time 0 Answers
Terrain Craters 2 Answers
Mesh destruction 1 Answer
How can I create a destructible soft body mesh? 2 Answers
Mesh Collider Edge Position. 0 Answers