Noid
A state machine like the Humanoid's, for custom character controllers.
Noid does not move anything or cast anything, it decides what state a character is in and tells you when that changes. Physics, raycast and replication stay with you.
lua
local Noid = require(game:GetService("ReplicatedStorage").Packages.Noid)
local machine = Noid.Machine.new("Idle", "client")
local desired = Noid.Conditions.resolve({ grounded = true })
if desired then
machine:Change({ state = desired, source = "sensor" })
endTypes
State type
luau
type State = "Idle"
| "Grounded"
| "Airborne"
| "Jumping"
| "Landed"
| "Falling"
| "Climbing"
| "Swimming"
| "Seated"
| "Flying"
| "Dead"
| "Frozen"StateInfo type
luau
type StateInfo = {
grounded: boolean,
airborne: boolean,
manual: boolean,
terminal: boolean,
enum_name: string?,
}ChangeSource type
luau
type ChangeSource = "sensor" | "driver" | "consumer" | "server" | "client"ChangeRequest type
luau
type ChangeRequest = {
state: State,
source: ChangeSource,
}StateChanged type
Realm type
luau
type Realm = "server" | "client" | "shared"Connection type
luau
type Connection = signal.ConnectionConditions type
luau
type Conditions = conditions.ConditionsMachine type
luau
type Machine = machine.MachineLifecycle type
luau
type Lifecycle = lifecycle.LifecycleTransition type
Disconnectable type
luau
type Disconnectable = {
Disconnect: (() -> ())?,
Destroy: (() -> ())?,
}Properties
Conditions Module
luau
Noid.Conditions: conditionsLifecycle Module
luau
Noid.Lifecycle: lifecycleMachine Module
luau
Noid.Machine: machineRealm Module
luau
Noid.Realm: realmSignal Module
luau
Noid.Signal: signalStates Module
luau
Noid.States: statesTransitions Module
luau
Noid.Transitions: transitions