Show raw api
{
"functions": [
{
"name": "new",
"desc": "Creates a new CharacterStateHandler for the given character model. \nIf a handler already exists for the character in the cache, it returns the cached instance.",
"params": [
{
"name": "character",
"desc": "The character model to manage.",
"lua_type": "Model"
}
],
"returns": [
{
"desc": "The handler instance.",
"lua_type": "CharacterStateHandlerType"
}
],
"function_type": "static",
"source": {
"line": 67,
"path": "global/ReplicatedStorage/Scripts/Modules/CharacterStateHandler.luau"
}
},
{
"name": "_init",
"desc": "Initializes the handler by connecting to physics updates and setting up \nreferences to the ControllerManager and HumanoidRootPart.",
"params": [],
"returns": [],
"function_type": "method",
"private": true,
"source": {
"line": 89,
"path": "global/ReplicatedStorage/Scripts/Modules/CharacterStateHandler.luau"
}
},
{
"name": "_updateState",
"desc": "Calculates the current state of the character based on velocity, grounding, \nand movement input.",
"params": [
{
"name": "deltaTime",
"desc": "The time elapsed since the last update.",
"lua_type": "number"
}
],
"returns": [],
"function_type": "method",
"private": true,
"source": {
"line": 112,
"path": "global/ReplicatedStorage/Scripts/Modules/CharacterStateHandler.luau"
}
},
{
"name": "getInstanceCache",
"desc": "Returns the internal cache of all active CharacterStateHandler instances.",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "{[Model]: CharacterStateHandlerType}"
}
],
"function_type": "static",
"source": {
"line": 148,
"path": "global/ReplicatedStorage/Scripts/Modules/CharacterStateHandler.luau"
}
},
{
"name": "GetCurrentState",
"desc": "Returns the current active state of the character.",
"params": [],
"returns": [
{
"desc": "The current state (Idle, Walk, Run, etc).",
"lua_type": "PlayerState"
}
],
"function_type": "method",
"source": {
"line": 156,
"path": "global/ReplicatedStorage/Scripts/Modules/CharacterStateHandler.luau"
}
}
],
"properties": [],
"types": [
{
"name": "PlayerState",
"desc": "Represents the possible activity states for a player character.",
"lua_type": "\"Idle\" | \"Walk\" | \"Run\" | \"Jump\" | \"Fall\"",
"source": {
"line": 27,
"path": "global/ReplicatedStorage/Scripts/Modules/CharacterStateHandler.luau"
}
},
{
"name": "CharacterStateHandlerType",
"desc": "Defines the structure and methods for managing the physical and logical state of a character.",
"fields": [
{
"name": "Character",
"lua_type": "Model",
"desc": "The physical character model associated with this handler."
},
{
"name": "CurrentState",
"lua_type": "PlayerState",
"desc": "The current activity state of the player (e.g., \"Idle\", \"Walk\")."
},
{
"name": "MovingDirection",
"lua_type": "Vector3",
"desc": "The direction the character is currently moving toward."
},
{
"name": "FacingDirection",
"lua_type": "Vector3",
"desc": "The direction the character is currently facing."
},
{
"name": "Velocity",
"lua_type": "Vector3",
"desc": "The current velocity vector of the character."
},
{
"name": "IsGrounded",
"lua_type": "boolean",
"desc": "Whether the character is currently touching the ground."
},
{
"name": "_init",
"lua_type": "(self: any) -> ()",
"desc": "Internal initialization routine for the handler."
},
{
"name": "_updateState",
"lua_type": "(self: any, deltaTime: number) -> ()",
"desc": "Internal logic for calculating and transitioning between states."
},
{
"name": "GetCurrentState",
"lua_type": "(self: any) -> PlayerState",
"desc": "Returns the current active state of the character."
},
{
"name": "new",
"lua_type": "(character: Model) -> CharacterStateHandlerType",
"desc": "Constructor for creating a new CharacterStateHandler instance."
}
],
"source": {
"line": 44,
"path": "global/ReplicatedStorage/Scripts/Modules/CharacterStateHandler.luau"
}
}
],
"name": "CharacterStateHandler",
"desc": "Handles the replication and management of character states from the StateManager to the client. \nThis class monitors character movement, grounding, and orientation to determine the current \nplayer activity state.",
"realm": [
"Client"
],
"source": {
"line": 11,
"path": "global/ReplicatedStorage/Scripts/Modules/CharacterStateHandler.luau"
}
}