> For the complete documentation index, see [llms.txt](https://speedtutoruk.gitbook.io/survival-game-vitals-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://speedtutoruk.gitbook.io/survival-game-vitals-doc/getting-started/quick-setup.md).

# Quick Setup

{% embed url="<https://youtu.be/_Gd9hdg5M68>" %}

{% hint style="info" %}
**QUICK START:** Use the included demo prefab to add all the required components to your scene with one drag and drop asset. Then customise to your liking!
{% endhint %}

1\). Add the “**Survival Interactor**” script to your main camera.

{% hint style="info" %}
Survival Interactor is the Raycast script for interacting with 3D objects.
{% endhint %}

* **Ray Length**: The distance you can interact with objects (Default: 5)
* **Interact Key**: This is the input key to interact with items in the scenes (Default: Mouse 0)

<figure><img src="https://1287620884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDGvZmOQuOQ7fHovtknZV%2Fuploads%2FqnGwBJQZd3hYsIjoZt52%2FRaycast.JPG?alt=media&amp;token=d7bfb622-85e9-4794-9546-21244dc86e62" alt=""><figcaption></figcaption></figure>

2\). Add “**Survival Vitals Manager**” to your hierarchy from the prefabs folder and you can use the settings as below or customise them to your liking:&#x20;

* **Player / Max Health:** The amount of health the player will currently have and the maximum.
* **Player / Max Stamina:** The amount of stamina the player will currently have and the maximum.
* **Stamina Drain:** How quickly stamina will fall (Higher is faster)
* **Stamina Regen:** How quality stamina will recover over time (Higher is faster)
* **Jump Cost:** How much stamina it will cost to perform a jump action
* **Player / Max Hunger:** The amount of hunger the player will currently have and the maximum
* **Hunger Drain:** How faster hunger will decrease (Higher is faster
* **Player / Max Thirst:** The amount of thirst the player will currently have and the maximum.
* **Thirst Drain:** How faster hunger will decrease (Higher is faster)
* **Single Damage:** This is the damage that will happen when one of Thirst or Hunger is depleted. (Divided by 100 in script - Keep whole numbers)
* **Double Damage:** This is the damage that will happen when BOTH thirst and hunger is depleted. (Divided by 100 in script - Keep whole numbers)
* **Death Event:** Add events for when you have run out of health

<figure><img src="https://1287620884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDGvZmOQuOQ7fHovtknZV%2Fuploads%2FO3cxnbcv1xQLMFpLNREE%2FSurvivalVitalsManager.JPG?alt=media&amp;token=7912084c-fbee-4aa2-a520-64e148d94b34" alt=""><figcaption></figcaption></figure>

3\). Add the canvases from the prefab folder, including:&#x20;

* CrosshairCanvas
* SurvivalUICanvas

4\). Add “**Survival UI Manager**” to your hierarchy from the prefabs folder and you can use the settings as below or customise them to your liking.

* Add the UI items as seen below to the missing slots from the crosshair and survival canvases

<figure><img src="https://1287620884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDGvZmOQuOQ7fHovtknZV%2Fuploads%2FAgq20OsmvV3uBz5JIhNY%2FSurvivalUIManager.JPG?alt=media&amp;token=ef33ea63-8e44-4e42-b665-7e084b40d1a8" alt=""><figcaption></figcaption></figure>

5\). Add “**Survival Audio Manager**”  to your hierarchy from the prefabs folder and you can use the settings as below or customise them to your liking.

{% hint style="info" %}
You can add ScriptableObjects to these audio slots in the array to play more sounds that just the ones provided.d
{% endhint %}

<figure><img src="https://1287620884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDGvZmOQuOQ7fHovtknZV%2Fuploads%2FfzJqHDbN4rotgXVvBsAK%2FSurvivalAudioManager.JPG?alt=media&amp;token=57dae17b-3997-4ba9-9a55-b6b54af5993a" alt=""><figcaption></figcaption></figure>

## Creating an interactive item:&#x20;

1\). Add a 3D model from the models folder or prefabs. Make sure the are setup as below:&#x20;

* Box Collider
* “**SurvivalItem**” script
  * Choose an item type for your interactive object
  * Item Value for the amount damage, healing or restoration of the vitals
  * Item Sound is the ScriptableObject

{% hint style="info" %}
Add “**SurvivalItem**” to any 3D object for it to become interactive
{% endhint %}

<figure><img src="https://1287620884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDGvZmOQuOQ7fHovtknZV%2Fuploads%2FVODVEGG2eh3YYHcV8QC5%2FSurvivalItem.JPG?alt=media&amp;token=02c04a99-62b6-436e-acac-351038af8184" alt=""><figcaption></figcaption></figure>
