- Home /
Question by
saabriwa12 · Nov 22, 2017 at 10:15 PM ·
unity5cars
unity car accident game
Hi, I want to Deformation my car unity when hit an object in unity 5. I really need helps .Thanks
Comment
Answer by jeffreyrampineda · Nov 22, 2017 at 11:01 PM
Hello! Place a script on an object the car will hit, then use the OnCollisionEnter(Collider c) method to change the c's Mesh by c.GetComponent to a deformed version of the car. Or you can do the opposite where the script is in the car and whenever you call OnCollisionEnter(), you just GetComponent of the car's mesh and change it to a deformed version. Here is a tutorial from Unity : https://www.youtube.com/watch?v=QRp4V1JTZnM Good luck!
Your answer