Health
The Health component goes on the root transform of a vehicle, and manages collectively all the damageables on the vehicle.
Toggle Vehicle Damage
To toggle vehicle damage in the editor, you can check/uncheck the Is Damageable checkbox in the inspector of the Health component.
To toggle it during gameplay, use the following code:
Toggle Vehicle Healing
To toggle vehicle healing in the editor, you can check/uncheck the Is Healable checkbox in the inspector of the Health component.
To toggle it during gameplay, use the following code:
Destroy Damageables
To destroy all the damageables on a vehicle during gameplay, use the following code:
Restore Damageables
To restore all the damageables on the vehicle, use the following code:
Vehicle Health Info
To query vehicle health information, you can use the following code:
Last updated