# Vehicle Setup

### Vehicle Health

To begin, add a **Health** component to the root transform of the vehicle.

### Damageable Components

For each damageable component on the vehicle, add a **Damageable** component somewhere in the vehicle's hierarchy and customize its health properties in the inspector.

### Colliders

For each game object that contains one or more colliders that represents a damageable component, add a **Damage Receiver** component and set the Damageable it refers to in the inspector.

### Detonators

When the vehicle or an individual damageable component on it is destroyed, you may want to spawn effects such as explosions. The **Detonator** class helps you do that.

To set up a Detonator:

1. If the detonator is for the whole vehicle, go to the **Vehicle** component and add the **Detonator**'s *Detonate* function to its *On Destroyed* event.
2. If the detonator is for the an individual damageable component, go to the **Damageable** component and add the **Detonator**'s *Detonate* function to its *On Destroyed* event.
3. Go to the inspector of the **Detonator** component, open the *Detonated State Spawn Objects* list, and add your explosion prefab there.


---

# 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/vehicle-setup.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.
