To simulate an explosion of a vheicle, I decided to do this:
- When I need to explode veichle , at runtime, i add rigidibody for every single part of veichle (5-10 part: door, wheel, hood etc), and collider (mesh).
- I detach them from parent
- I apply an AddExplosionForce to every single part
This cause a big lag in my game, so I'm supposing this is not the efficent way.
The other way could be to add Rigidbody and Collider in my prefab, with Rigidbody.gravity = false, and isKinematic=true, then enabling after explosion, but also this is not good for performance.
Do you have some suggestions to achive my scope, considering that I could have a lot (5-10) enemy veichles at time on my scene ?