TypeDefinitions
Shared Luau type definitions used across Motix and MotixNet.
This page documents every field on the core data types. You do not import this module directly. It exists as an API reference for the types that flow through the system.
Types
AnimationConfig
interface AnimationConfig {Name: string--
Unique animation identifier. Passed to Controller:Play() and Controller:Stop().
AssetId: string--
Roblox animation asset ID ("rbxassetid://...").
Layer: string--
Layer this animation belongs to. Must match a registered LayerProfile name.
Group: string?--
Exclusive group name. Only one animation per group may play at a time.
Priority: number--
Conflict priority within the layer or group. Higher values win. Default: 0.
Looped: boolean--
Whether the animation loops. Default: false.
FadeInTime: number--
Seconds for the animation to fade in when it starts playing. Default: 0.1.
FadeOutTime: number--
Seconds for the animation to fade out when it stops. Default: 0.1.
Speed: number--
Playback speed multiplier. Default: 1.0.
Weight: number--
Blend weight contribution within its layer. Range (0, 1]. Default: 1.0.
CanInterrupt: boolean--
Whether a lower-priority group member can replace this animation before it finishes. Default: true.
MinDuration: number?--
Minimum seconds the animation must play before group conflict resolution can interrupt it.
Tags: {string}--
Tag strings for batch operations via Controller:PlayTag(). Default: {}.
Additive: boolean--
Whether the animation plays in additive blending mode. Default: false.
Metadata: {[string]: any}?--
Arbitrary data stored with the config. Accessible from registry lookups.
}
Defines a single animation. All fields are required unless marked optional.
Produced by BehaviorBuilder:Animation():Done() and stored in AnimationRegistry.
Once registered, configs are frozen. Modifying them after AnimationRegistry:Init()
has no effect.
LayerProfile
interface LayerProfile {Name: string--
Unique layer identifier. Referenced by AnimationConfig.Layer, state ActiveLayer, and SuppressLayer.
Order: number--
Integer blending order. Lower values are evaluated first. Must be unique per behavior.
BaseWeight: number--
Default layer weight when the layer is active. Range [0, 1]. Default: 1.0.
Additive: boolean--
When true, this layer composes with lower-order layers rather than replacing them. Default: false.
Isolated: boolean--
When true, this layer does not interact with other layers during blending. Default: false.
WeightLerpRate: number--
Speed in units per second at which the layer weight interpolates toward its target. Use math.huge for instant snapping. Default: 8.0.
}
Defines an animation layer. Layers control how animations blend and which animations can
coexist. Produced by BehaviorBuilder:Layer():Done().
StateDefinition
interface StateDefinition {Name: string--
Unique state name. Referenced by InitialState, Transition.ToState, and RequestStateTransition.
ActiveLayers: {string}--
Layers set to their BaseWeight when this state is entered.
SuppressLayers: {string}--
Layers set to weight 0 when this state is entered.
}Defines a state in the state machine. Produced by BehaviorBuilder:State():Done().
States with no Transitions are terminal states. The state machine stays in them until
RequestStateTransition is called.
AnimationDirective
interface AnimationDirective {Action: "PLAY" | "STOP" | "STOP_GROUP"--
The action to perform.
Target: string--
Animation name (for PLAY and STOP) or group name (for STOP_GROUP).
Immediate: boolean--
For STOP and STOP_GROUP: whether to stop without a fade-out.
}A single action in a state entry or exit list.
TransitionRule
interface TransitionRule {ToState: string--
The target state name. Must be a defined state in the behavior.
Condition: string--
The predicate name. Must be a registered predicate.
Priority: number--
Tiebreaker when multiple transitions are satisfied simultaneously. Higher wins.
}A single transition definition within a state.
AnimationIntent
interface AnimationIntent {CharacterId: string--
The character this intent is for.
AnimationName: string--
The resolved animation name.
Action: "PLAY" | "STOP"--
The requested action.
Timestamp: number--
Server time at which the intent was created (workspace:GetServerTimeNow()).
}Represents an animation play/stop intent in the MotixNet system.
ControllerConfig
interface ControllerConfig {CharacterId: string--
Unique identifier for this character instance.
IsOwningClient: boolean--
Whether this client owns the character. Controls MotixNet intent sending.
OwningPlayer: Player?--
The player who owns this character. Used by MotixNet for ownership validation.
InitialState: string--
The state the machine begins in.
Predicates: {[string]: () → boolean}--
Named boolean predicate functions for transition conditions.
}
Configuration table passed to AnimationController.new(). Typically produced by
BuiltBehavior:CreateController().