본문으로 건너뛰기
Skillpedia
일반 코딩6.6k · #13836

roblox-characters

하는 일

이 스킬은 리스폰, 사망, 그 밖의 변화를 견디는 Roblox 캐릭터 스크립트를 작성하는 방법을 보여 줍니다. Roblox 경험에서 플레이어 캐릭터를 만드는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓플레이어가 Roblox에서 리스폰한 후 캐릭터 스크립트가 깨질 때.
  • ✓Roblox에서 캐릭터 이동을 제어하거나, 애니메이션을 재생하거나, 사망을 처리해야 할 때.
  • ✓플레이어 캐릭터에 도구를 장착하거나 액세서리를 바꾸고 싶을 때.

스킬 링크

https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/roblox-characters/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/roblox-characters/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 Roblox 캐릭터가 리스폰한 후 속도가 원래대로 돌아가요. 스크립트를 어떻게 고쳐야 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

리스폰 후에도 플레이어는 그대로 유지되지만 캐릭터는 임시라는 점을 설명합니다. 그래서 에이전트는 오래 유지되는 데이터와 캐릭터별 연결을 분리하고, 후자는 정리합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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

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

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:De
자주 묻는 질문

Roblox에서 플레이어와 캐릭터의 차이는 무엇인가요?

플레이어는 게임을 하는 동안 그대로 유지되고, 캐릭터는 생성될 때마다 새로 만들어지는 몸입니다.

R6와 R15 리그도 다루나요?

네. 이 스킬은 애니메이션과 캐릭터 파트를 설정할 때 두 가지 리그 타입을 모두 다룹니다.

물리나 리모트도 다루나요?

그것들은 별도의 Roblox 스킬입니다. 하나는 물리, 다른 하나는 네트워킹을 다룹니다.

상세 정보

작성자의 원본 설명

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.

repo: gamedev-skills/awesome-gamedev-agent-skills

인기도

GitHub 스타
6.6k
순위
#13836
라이선스
Apache-2.0
업데이트
2026. 10. 28.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬