Roblox characters
Treat a Player as the durable identity and each Character as a replaceable session with its own
references, connections, animation tracks, and cleanup. Targets Roblox's rolling platform APIs.
When to use
- Use for player-character lifecycle, Humanoid state/movement, rigs, animations, tools, accessories, custom characters, death, or respawn defects.
- Use whenever code stores a Character/Humanoid/root reference longer than one spawn.
When not to use: general physics queries and constraints belong to roblox-physics; remote
trust belongs to roblox-networking; camera logic belongs to camera-systems.
Workflow
- Inspect the character contract. Check avatar settings,
StarterCharacter,StarterCharacterScripts,CharacterAutoLoads, R6/R15 support, existing Animate/controller scripts, tools, tags, collision groups, and server/client ownership. - Separate scopes. Player-scope state survives respawn; character-scope state does not. Put character connections/tracks/resources in one cleanup scope and destroy it on removal.
- Bind existing and future characters. Connect
CharacterAdded, then bindplayer.Characterif present. Do not assume event subscription alone sees a character that already spawned. - Resolve required components defensively. Wait with a timeout where replication warrants it;
validate
Humanoid, root,Animator, and rig assumptions. Abort if that character is no longer current before applying delayed work. - Choose movement ownership. Use Humanoid movement for standard avatars; use
AssemblyLinearVelocity,BasePart:ApplyImpulse(), or aLinearVelocity/AlignPositionconstraint only for mechanics that need physical control. Keep gameplay authority and network ownership implications explicit. - Own animation lifecycle. Load via the rig's
Animator; store tracks/connections; use named markers for gameplay timing only with server validation; stop/disconnect on character cleanup. - Verify lifecycle stress. Spawn, die, reset, rapid-respawn, swap rig if supported, equip/drop tools, leave during setup, and run with at least two players when character interactions matter.
Pattern: replaceable character scope
Use the project's cleanup utility when one exists; do not introduce a new framework for three
connections. Server systems repeat this binding per Player and clear player-scope tables on
PlayerRemoving.
Pattern: animation through Animator and markers
For rigs without a Humanoid, use an AnimationController with an Animator. Do not use the
deprecated convenience path as a substitute for owning the actual Animator and track lifecycle.
Movement and rig rules
- Do not hardcode R15 limb names if R6 is supported. Prefer attachments, tags, or a rig-type
adapter; branch on
Humanoid.RigTypeonly where topology materially differs. HumanoidRootPartis the usual character assembly root, not a universal guarantee for every custom model. Define the custom rig contract and validate it at spawn.- Prefer
Humanoid:Move()/standard controls for ordinary avatar locomotion. Directly changingAssemblyLinearVelocityis an instantaneous physical action; use forces/constraints or impulses when continuous or instantaneous physics is the real intent. - To rebind movement/jump or add actions like sprint, prefer the Input Action System
(
InputContext/InputAction/InputBinding, defined at edit time and cross-device) over hookingUserInputServicedirectly. Default player and character control scripts run on this system whenWorkspace.PlayerScriptsUseInputActionSystemis enabled, exposing defaultPlayerScriptscontexts; give your ownInputContexta higherPriority(andSink) to take precedence over the default bindings. See theroblox-uiinput and navigation reference for the UI-focus side of this. - Never grant damage or movement authority because a client owns its character physics. Validate cross-player consequences on the server.
- Tools move between Backpack and Character during equip; listen to lifecycle/state rather than
assuming one fixed parent. Modify accessories/appearance through current character APIs and
preserve an up-to-date applied
HumanoidDescriptionwhen editing avatar appearance.
Common failures
Resources
- Read
references/lifecycle-and-animation.mdfor server binding, death vs removal, rig and animation verification, custom characters, and the lifecycle stress matrix.
Related skills
roblox-physics— forces, constraints, assemblies, collision, and network ownership.roblox-networking— server validation of character actions and stale requests.input-systems— action mapping and responsive movement intent.camera-systems— camera behavior following replaceable characters.
Primary references
https://create.roblox.com/docs/charactershttps://create.roblox.com/docs/animation/usinghttps://create.roblox.com/docs/characters/appearance


