К основному содержанию
скилл CX Codex

roblox-characters — скилл для Claude Code: персонажи Roblox без багов

Помогает строить системы персонажей в Roblox так, чтобы скрипты не ломались после респавна и не держали устаревшие ссылки на Humanoid.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-characters -a claude-code
Открыть на GitHub

Что делает roblox-characters

Скилл описывает жизненный цикл персонажа: Player остаётся постоянной сущностью, а каждый Character — временная сессия со своими ссылками, соединениями и анимационными треками. Отсюда главное правило: всё, что привязано к персонажу, живёт в одном scope и уничтожается при его удалении, а состояние уровня игрока переживает респавн.

Внутри — рабочий процесс из семи шагов и два готовых шаблона на Lua. Один показывает привязку через CharacterAdded с проверкой player.Character и счётчиком поколений, чтобы отложенный вызов не снёс актуальную привязку. Второй — загрузка анимаций через Animator с маркерами и корректной остановкой треков при очистке персонажа. Есть отдельный блок про движение и риги: не хардкодить имена конечностей R15, если поддерживается R6, и не выдавать клиенту право на урон только потому, что он владеет физикой своего персонажа.

Скилл не для общих задач по физике, сетевому доверию и камере — для них в наборе есть отдельные единицы. Учтите, что часть про инструменты и аксессуары обрывается на полуслове, так что по экипировке рассчитывайте на общие принципы жизненного цикла, а не на разобранный пример.

Какие задачи решает

  • починить скрипт персонажа, который ломается после респавна
  • убрать устаревшие ссылки на Humanoid и HumanoidRootPart
  • загрузить AnimationTrack через Animator и вовремя его остановить
  • обработать смерть персонажа и очистить соединения
  • поддержать кастомный риг без Humanoid

Примеры запросов агенту

  • Мой скрипт движения перестаёт работать после респавна — перепиши его через CharacterAdded и один cleanup scope
  • Загрузи анимацию удара через Animator и повесь маркер для эффекта на клиенте
  • У меня R6 и R15 — убери хардкод имён конечностей R15 из кода персонажа

Как установить roblox-characters

1Через Skills CLI (Vercel)

npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-characters -a claude-code

2Вручную: положить файлы

~/.claude/skills/roblox-characters/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/roblox-characters/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора77

ai-behavior-trees-utility-ai Помогает реализовать деревья поведений и систему Utility AI для игровых NPC. Пригодится при создании логики ботов в Unity или Godot за пределами обычного FSM. CX Codex +1 4 900установок roblox-ui Скилл для сборки интерфейсов Roblox: жизненный цикл ScreenGui, адаптивные UDim2-раскладки, ввод с геймпада и тача. Пригодится, когда UI обрезается или сбрасывается после респавна. CX Codex +1 3 800установок roblox-studio-workflow Скилл задаёт порядок правок в существующих проектах Roblox Studio: от осмотра структуры до проверки в Studio и очистки тестовых объектов. CX Codex +1 3 700установок roblox-networking Скилл для проектирования и защиты клиент-серверной сети в Roblox: RemoteEvent, RemoteFunction, UnreliableRemoteEvent, проверки и лимиты. CX Codex +1 3 500установок roblox-physics Скилл для работы с физикой Roblox: сборки, ограничения, группы столкновений, рейкасты и владение по сети. Пригодится, когда .Touched врёт или механизм дрожит. CX Codex +1 3 500установок godot-gdscript-headless-testing Скилл помогает настроить запуск тестов GDScript в Godot 4 через консоль с флагом --headless. Он нужен для проверки логики в CI без запуска графического редактора. CX Codex +1 3 100установок ebitengine-game Скилл для агентного кодинга, который помогает собирать, отлаживать и упаковывать 2D-игры на Go с Ebitengine. Пригодится, когда нужен рабочий игровой цикл, а не один удачный скриншот. CX Codex +1 659установок defold-core Помогает собирать и отлаживать игры на Defold: настраивать game.project, связывать скрипты на Lua, передавать сообщения и проверять сборку через Bob. CX Codex +1 623установок

Похожие

roblox-animation-vfx TabooHarmony Скилл для ИИ-агента, который помогает писать и чинить анимации, партиклы, лучи, трейлы и твины в Roblox. CX Codex +1 2 300установок roblox-animations sentinelcore Справочник по анимациям Roblox: загрузка треков, приоритеты, замена стандартных анимаций персонажа. Пригодится, когда агент пишет код для Humanoid или рига на AnimationController. CX Codex +1 905установок roblox-monetization sentinelcore Скилл для ИИ-агента, который ведёт через настройку Game Passes, Developer Products, UGC-предметов и Premium Payouts в Roblox. CX Codex +1 560установок roblox-animation nonlooped Скилл для анимаций персонажей Roblox: треки, IK-позы, события по маркерам и твины интерфейса. Пригодится, когда нужно собрать локомоцию или эмоцию и не сломать приоритеты. CX Codex +1 392установок roblox-luau-types TabooHarmony Скилл для аннотаций типов Luau: дженерики, юнионы, сужение типов, строгий режим, экспорт типов из модулей. Пригодится при миграции на --!strict. CX Codex +1 2 000установок mm2-roblox-analytics-toolkit reason-machines Скилл для аналитики Murder Mystery 2: инвентарь, статистика матчей и разбор стратегий через ИИ-рекомендации. Пригодится, если ведёте учёт скинов и хотите видеть винрейт по ролям. CX Codex +1 2 400установок

Рядом в теме «Геймдев и 3D: Unity, Unreal, Godot, Blender»

Всё по теме «Геймдев и 3D: Unity, Unreal, Godot, Blender» →

Вопросы о roblox-characters

Как установить roblox-characters в Claude?

Выполните npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill roblox-characters -a claude-code. Скилл появится в ~/.claude/skills/roblox-characters/SKILL.md.

Что делает roblox-characters?

Описывает жизненный цикл персонажа Roblox: привязку через CharacterAdded и CharacterRemoving, работу с Humanoid, ригами R6/R15, анимациями, смертью и кастомными персонажами. Помогает не хранить ссылки на персонажа дольше одного спавна.

С какими другими скиллами он сочетается?

Общая физика и ограничения — это roblox-physics, доверие к удалённым вызовам — roblox-networking, логика камеры — camera-systems. Сам roblox-characters эти темы не покрывает.

Исходный текст

SKILL.md · Apache-2.0
---
name: roblox-characters
description: >
  Build respawn-safe Roblox character systems around Players, CharacterAdded/CharacterRemoving,
  Humanoid, HumanoidRootPart, Animator, R6/R15 rigs, movement, animations and markers, death,
  tools, accessories, ownership, and custom characters. Use when character scripts break after
  respawn, cache stale Humanoids, control movement or velocity, load AnimationTracks, handle death,
  equip Tools, modify avatars, or support custom player rigs.
---

# 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

1. **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.
2. **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.
3. **Bind existing and future characters.** Connect `CharacterAdded`, then bind `player.Character`
   if present. Do not assume event subscription alone sees a character that already spawned.
4. **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.
5. **Choose movement ownership.** Use Humanoid movement for standard avatars; use
   `AssemblyLinearVelocity`, `BasePart:ApplyImpulse()`, or a `LinearVelocity`/`AlignPosition`
   constraint only for mechanics that need physical control. Keep gameplay
   authority and network ownership implications explicit.
6. **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.
7. **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

```lua
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local generation = 0
local connections: {RBXScriptConnection} = {}
local currentCharacter: Model? = nil

local function clearCharacter()
    generation += 1
    for _, connection in connections do connection:Disconnect() end
    table.clear(connections)
    currentCharacter = nil
end

local function bindCharacter(character: Model)
    -- Guard BEFORE teardown. A stale invocation (see the CharacterAdded/defer race below) must not
    -- clear a binding that is already current, or nothing ends up bound at all.
    if player.Character ~= character then return end
    clearCharacter()
    currentCharacter = character
    local thisGeneration = generation
    local humanoid = character:WaitForChild("Humanoid", 10)
    local root = character:WaitForChild("HumanoidRootPart", 10)
    -- Re-check after the yields: a respawn during WaitForChild bumps generation and makes this call stale.
    if not humanoid or not root or generation ~= thisGeneration then return end

    table.insert(connections, humanoid.Died:Connect(function()
        if generation ~= thisGeneration then return end
        setCharacterUiEnabled(false)
    end))
    attachCurrentCharacterSystems(character, humanoid, root)
end

player.CharacterRemoving:Connect(function(character)
    if currentCharacter == character then clearCharacter() end
end)
player.CharacterAdded:Connect(bindCharacter)
if player.Character then task.defer(bindCharacter, player.Character) end
```

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

```lua
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://1234567890"
local track = animator:LoadAnimation(animation)
local markerConnection = track:GetMarkerReachedSignal("Commit"):Connect(function(parameter)
    playLocalSwingEffect(parameter) -- presentation; server still validates any hit
end)

track:Play(0.1)
-- On character teardown:
markerConnection:Disconnect()
track:Stop(0.1)
animation:Destroy()
```

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.RigType` only where topology materially differs.
- `HumanoidRootPart` is 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 changing
  `AssemblyLinearVelocity` is 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 hooking `UserInputService` directly. Default player and character control scripts
  run on this system when `Workspace.PlayerScriptsUseInputActionSystem` is enabled,
  exposing default `PlayerScripts` contexts; give your own `InputContext` a higher
  `Priority` (and `Sink`) to take precedence over the default bindings. See the
  `roblox-ui` input and navigation reference for the UI-focus side of this.
- Check whether the place opted into the Character Controller Library (beta; Avatar Settings ⟩
  Movement ⟩ Abilities) or a `ControllerManager` setup. Those replace `HumanoidStateType`-driven
  logic with abilities/controllers, so extend that system instead of layering Humanoid state
  changes on top of it.
- 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 `HumanoidDescription` when editing avatar appearance.

## Common failures

| Symptom | Likely cause | Remedy |
|---|---|---|
| works once, breaks after reset | cached character/Humanoid/root | rebuild per `CharacterAdded`; clear on removal |
| callbacks fire twice after deaths | old character connections survived | character-scoped cleanup and generation/current checks |
| delayed load edits wrong rig | async work outlived spawn | compare current Character/generation after every yield |
| animation visible only locally or not at all | wrong Animator/context/asset ownership | inspect rig Animator, execution side, permissions, and replication |
| hit marker awards impossible hit | animation marker trusted as authority | use marker for timing/presentation; server validates combat state |
| R6/custom rig errors | R15 names assumed | define rig contract; attachments/adapter; test each supported rig |
| tool disappears from system | fixed Backpack/Character parent assumed | handle equip/unequip ancestry and character replacement |
| custom force fights Humanoid | two controllers own motion | choose one movement authority per state and restore cleanly |

## Resources

- Read `references/lifecycle-and-animation.md` for 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/characters`
- `https://create.roblox.com/docs/animation/using`
- `https://create.roblox.com/docs/characters/appearance`
- `https://create.roblox.com/docs/characters/character-controller-library`

© gamedev-skills · Apache-2.0 · gamedev-skills/awesome-gamedev-agent-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой