State Handler
Last updated
Was this helpful?
Last updated
Was this helpful?
The State Handler is the component in FP Motion that checks all the events that the player is triggering and decides on the player's state based on them.
Once it decides on a state, it collects the from it and passes it to the components in the asset that need it via events.
The State Handler has two important methods, the GetCameraState, and GetWeaponState methods, these two calculate what state the player is in based on information gotten from events.
Both of them return the same state, but different , this allows you to have different information for cameras and guns, or other objects in the game based on the state.
When in need to grab the current state data from the handler, you can use the following code: