- Home /
Question by
3dDude · Apr 15, 2010 at 03:13 PM ·
objectsdestructible
object destroying
hi have you seen unity studios video on there projects here anyway at the end they have the tank game. the house in that demo seems to be destructible anyone know how? if you do can you post some code please
Comment
Best Answer
Answer by spinaljack · Apr 15, 2010 at 04:11 PM
You can make the house out of individual rigid bodies set to kinematic (no physics simulation) initially. Give the house a large hit box that covers the whole house. When a projectile or tank hits the house set all it's pieces to kinematic = false and they should fly about and fall to the ground as you expect.
better yet, loop through all the children of the house and add a rigidbody and collider to them so that they initially have not colliders or rigidbodies to save performance