Skip to main content

Getting Started

Set-up health and stamina in under 5 minutes.

Setting Up Vitals Components

Get started by adding the health or stamina component to your character.

Inspector Image

Creating a Vitals Config

Right click in your project files and create a new VitalsConfig

Create Configuration

Define the maximum and starting values of the VitalsConfig and assign the config to the health or stamina component.

Basic Usage

To alter the value of the Vitals Component, get a reference to the component in your script.

private Health health;

private void Awake(){
health = GetComponent<Health>();
}

To get the value and max value, use:

health.Value

health.MaxValue

To increase or decrease the value, use:

health.Increase(10f);

health.Decrease(10f);

To manipulate the max value, use:

health.IncreaseMax(10f);

health.DecreaseMax(10f);

To set the value to an exact value, use:

health.SetMax(100f);

health.Set(100f);

Congrats!, you have completed the setup of the core VitalsComponents