# Stats

## Overview

Stats are advanced float values that are used to identify Attributes on the Animal and respond to their changes. They are managed on the Stats Component, on a list of Stat.

{% hint style="success" %}
E.g. if the **Health** stat gets to **zero** we can Activate the [**Death** ](https://malbersanimations.gitbook.io/animal-controller/main-components/manimal-controller/states/death)State on the animal.
{% endhint %}

## Properties

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M5DxQE9r4CkogL8Iu5-%2F-M5E3N7x0jiXWfde4tNr%2Fimage.png?alt=media\&token=4174a5e4-f9c1-4684-8c97-9c1538d9f29b)

### Active

Enable/Disable a stat

### ID

ID is the Identifier scriptable object used to know which stat is which... the Name of the Scriptable asset works too as the name of the Stat.

### Value

Current Value of the stat

### Multiplier

Multiplier for the stat. this will modify result of the methods that changes the Value of the stat.  This can be used to reduce the Health by half if the Animal has armor, or make double damage if the animal is vulnerable.

### Min Value

Minimum Value of the stat

### Max Value

Maximum value of the stat

### Regenerate

Allows the Stat to Regenerate

### Regenerate Rate

How fast the Stat will regenerate

### Regenerate Wait Time

When the value of the stat changes, it will wait X amount of time until the Regeneration logic is activated.

### Degenerate

Allows the Stat to Degenerate

### Degenerate Rate

How fast the stat will degenerate

### Degenerate Wait Time

When the value of the stat changes, it will wait X amount of time until the Degeneration logic is activated.

### Reset To

When the stat.Reset() method is called the Value will go to the Max or Min Value depending this parameter.

### Inmune Time

Time needed to pass so the stat can be modified again.

## Events

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M5DxQE9r4CkogL8Iu5-%2F-M5E4jX3rXd5kc-BnGr_%2Fimage.png?alt=media\&token=21e7ab09-45fb-41a5-929b-2c29cfc09d91)

### On \[Stat] change

Is invoked when the **stat** value is changed.

### On \[Stat] change Normalized

Is invoked when the **stat** value changes, but with a normalized value, using the **Min** and **Max** value stat

### On \[Stat] Max Value Change

Is invoked when the **Stat's Max Value** is changed

### On \[Stat] Active

Is invoked when the **stat** becomes active

### On \[Stat] Full

Is invoked when the **Stat** value is equal to the Max Stat value

### On \[Stat] Empty

Is invoked when the **Stat** value is equal to the Min Stat value

### On \[Stat] Regenerate

Invoked when the **Stat** is regenerating

### On \[Stat] Degenerate

Invoked when the **stat** is degenerating&#x20;

### On \[Stat] Below \[X]

Invoked when the **stat** value is below X

### On \[Stat] Above \[Y]

Invoked when the **stat** value is above X
