# PlayerStats

PlayerStats inherits from [IDamageable.cs](/fps-engine-documentation/content/03.-content/03.6-enemies/idamageable.md), which is an [interface](https://learn.unity.com/tutorial/interfaces). Notice that all Damageable objects in FPS Engine inherit from [IDamageable.cs](/fps-engine-documentation/content/03.-content/03.6-enemies/idamageable.md).

PlayerStats also implements these interfaces: IPlayerStatsProvider, IFallHeightProvider

**PLAYER STATES**

* <mark style="color:purple;">maxHealth</mark>: The initial amount of health points the player has.
* <mark style="color:purple;">maxShield</mark>:  The initial amount of shield points the player has.

&#x20;**FALL DAMAGE**

* <mark style="color:purple;">takesFallDamage</mark>:Enables or disables fall damage. When true, the player takes damage when falling from a great height.
  * <mark style="color:purple;">minimumHeightDifferenceToApplyDamage:</mark> The minimum distance (in units) the player must fall to take fall damage.
  * <mark style="color:purple;">FallDamageMultiplier</mark> A multiplier applied to the base fall damage to determine the final damage dealt. Higher values mean greater damage per unit fallen.

**AUTO HEAL**

* <mark style="color:purple;">enableAutoHeal</mark>: Enables or disables automatic player healing over time.
  * <mark style="color:purple;">healRate:</mark> The rate at which the player's health regenerates.
  * <mark style="color:purple;">healAmount:</mark> The amount of health regained with each heal tick (alternative to healRate for discrete healing).
  * <mark style="color:purple;">restartAutoHealAfterBeingDamaged:</mark>When true, being damaged resets the auto-heal timer, delaying healing until the timer expires again.

    * <mark style="color:purple;">restartAutoHealTime:</mark> The time (in seconds) it takes for auto-heal to resume after being disabled by damage (if `restartAutoHealAfterBeingDamaged` is true).

### Functions and Accessors | PlayerStats.cs&#x20;

> <mark style="color:green;">Respawn( Vector3 position )</mark>
>
> Respawns the player at a given position.&#x20;
>
> * position: Position to teleport the player to.

***

PlayerStatsEditor.cs can be found as an external script.


---

# 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://cowsinss-organization.gitbook.io/fps-engine-documentation/content/03.-content/03.3-player/playerstats.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.
