# 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:

```
// Make vehicle un-damageable
myVehicleHealth.IsDamageable = false;

// Make vehicle damageable
myVehicleHealth.IsDamageable = true;
```

### 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:

```
// Make vehicle un-healable
myVehicleHealth.IsHealable = false;

// Make vehicle healable
myVehicleHealth.IsHealable = true;
```

### Destroy Damageables

To destroy all the damageables on a vehicle during gameplay, use the following code:

```
// Destroy all damageables on the vehicle
myVehicleHealth.DestroyAllDamageables();
```

### Restore Damageables

To restore all the damageables on the vehicle, use the following code:

```
// Restore all damageables on vehicle
myVehicleHealth.ResetHealth();
```

### Vehicle Health Info

To query vehicle health information, you can use the following code:

```
// Get current health by health type
float currentHealth = myVehicleHealth.GetCurrentHealthByType(someHealthType);

// Get max health by health type
float maxHealth = myVehicleHealth.GetMaxHealthByType(someHealthType);

// Get current health fraction (0.0 to 1.0) by health type (useful for health bars)
float healthFraction = myVehicleHealth.GetCurrentHealthFractionByType(someHealthType);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vsxgames.gitbook.io/universal-vehicle-combat/health-system/health-framework/health.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
