# PlayerStates

Allows the player to utilize and access the Player States.

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

> <mark style="color:orange;">CurrentState ( PlayerBaseState ) / Public get / Private set</mark>
>
> Returns the current state of the state machine ( which inherits from PlayerBaseState )

> <mark style="color:orange;">\_States ( PlayerStateFactory ) / Public get / Private set</mark>
>
> Returns[ ](#playerbasestate.cs)all the PlayerStates.

> <mark style="color:green;">ForceChangeState(PlayerBaseState newState)</mark>
>
> Forces the state machine to switch states.

{% hint style="info" %}
Take a look at an example of implementation for <mark style="color:green;">ForceChangeState</mark> ( Assuming you previously have a reference for PlayerStates )
{% endhint %}

```csharp
PlayerBaseState myNewState = playerStates._States.Default();
playerStates.ForceChangeState(myNewState);
```


---

# 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/player-states/playerstates.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.
