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.