Search Unity

General method of handling armour at different points

Discussion in 'Scripting' started by Ghidera, Aug 14, 2015.

  1. Ghidera

    Ghidera

    Joined:
    Mar 6, 2013
    Posts:
    53
    I'm playing around with armoured vehicles and I want to create a damage system that takes into account various thicknesses of armour around a vehicle.

    My first thought was to try and figure out where a collision takes place and refer to a table for the armour value. As far as I know, as long as there is a rigidbody somewhere in the parent object I can get a hit location on the mesh object. I'm hoping that location data would have enough information to pinpoint the hit on the mesh. I'd like to add decals at the impact points to show hits (probably not deforming meshes, just decals) so I figure I'll need to get the hit locations regardless of how armour values are handled.

    My second thought was to add primitive colliders (sort of like bolting on steel plates). From the plate hit I could determine what part of the vehicle was hit and use the appropriate armour column to determine and record the damage done. I could assign a single armour value to the vehicle (the lowest) then use the plates as additional armour, maybe subtracting damage potential from the projectile prior to the collision with the vehicle mesh depending on the plate armour value.

    My third and final thought was to create simplified meshes of the various locations on the vehicle and use those for colliders instead of the detailed meshes or primitive colliders.

    What would you folks suggest for an approach to this? Any of the above or something altogether different?