- Home /
How to achieve realistic car damage ?
I want to make a game with realistic car damage, by which I mean when two cars collide, their mesh or submeshes deform in a believable way.
I'm wondering what are the possible ways of achieving such a result ?
My first approach has been to find the points in the mesh that are close to the contact points returned by the Collision object of the OnCollisionEnter function. I was thinking of then trying to find the other points that are contained inside those contact points to find what the actual contact surface was and then push those in along with the other points behind it.
I'm sure there are other ways to do it. This one seems a bit complicated.
Would it be possible to use soft bodies in order to let the physics engine process the deformation ? Or would there be advantages in terms of performance to use a shader to animate / deform the mesh ?
I'm worried my approach will be very CPU intensive as I would like to have several relatively complex car models (it won't be a simple box) able to process those deformations without it freezing. Ideally it could run on mobile too.
Edit : Also I don't want to use an asset for this, I'm really interested in how it's done and would like to do it on my own.
Answer by TutiBueno2 · Jul 17, 2015 at 02:47 PM
Edy's Vehicle Physics does have this feature. More info here: https://www.assetstore.unity3d.com/en/#!/content/403
Thanks, but I should probably have mentioned I really want to try and make this myself, for learning purposes.
Answer by lrpsantiago · Jul 17, 2015 at 04:26 PM
Well, a simple way (maybe archaic) to do this is to separate your car in small parts, empty GameObjects to attach a part model. Then, for each part's model, you make a damaged version of that part. And then, when the collision happens on that part, you replace that part for its damaged version (and maybe the surrounding parts too). To make this more realistic, you can make many levels of damage, it's up to you. So, for example you can make:
FrontBumperNew -> FrontBumperLightDamaged -> FrontBumperHeavyDamaged
Unfortunatelly, it's almost the same concept of car customization, and this might be laborious to do because of the amount of models, but it's an option. Simulating this by mesh deformation should be ideal. Take a look at this topic: http://forum.unity3d.com/threads/the-best-moethod-for-car-damage-mesh-deformation.109490/
Your answer
![](https://koobas.hobune.stream/wayback/20220611231731im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Car damage 1 Answer
Cant seem to make this basic 3D car turn properly 0 Answers
How to go about displaying car damage? 0 Answers
(UnityCar) Starting Engine 0 Answers
Need for speed like physics using Edy's vehicle physics? 1 Answer