대부분의 게임은 플레이어가 자신의 Roblox 아바타를 사용할 수 있도록 허용하지만, 일부는 UGC 홈스토어 템플릿과 같은 게임 내 사용자 정의 시스템을 구현합니다. 다른 게임은 헬멧, 날개 또는 장르에 맞는 액세서리와 같은 플레이어 아바타에 대한 제한된 수정을 수행합니다.
사용자의 외형을 변경하는 독특한 게임을 만들기 위해, 아바타 설정을 통해 기본 캐릭터 속성을 사용자 정의하거나 수동으로 외형 수정할 수 있습니다.
전역 아바타 설정
Studio의 파일 ⟩ 아바타 설정을 통해 게임 내 여러 전역 플레이어 캐릭터 속성을 빠르게 설정할 수 있습니다. 이러한 설정은 게임에 참여하는 모든 플레이어 캐릭터 모델에 전역적으로 적용됩니다. 특정 캐릭터, 예를 들어 비플레이어 캐릭터 모델을 수정하려면 수동으로 외형 수정을 참조하세요.
이 창에서는 의류, 액세서리, 신체 부위, 충돌 동작, 애니메이션 등 다양한 프리셋을 설정할 수 있습니다. 이러한 설정을 편집할 때 적용된 설정의 미리보기가 작업 공간에 표시됩니다.
자세한 내용은 아바타 설정을 참조하세요.
수동으로 외형 수정
캐릭터 모델에는 모델에 특별한 특성을 부여하는 Humanoid 객체가 포함되어 있습니다. 예를 들어 걷기, 점프, 아이템 장착 및 환경과 상호작용하는 기능이 있습니다.
Humanoid를 업데이트하여 프로그래밍 방식으로 HumanoidDescription을 수정할 수 있습니다. 여기에는 게임 내 플레이어 캐릭터 모델 또는 비플레이어 캐릭터 모델이 포함됩니다.
게임 내에서 HumanoidDescription을 사용하여 다음과 같은 캐릭터 속성을 조정할 수 있습니다:
| 캐릭터 속성 | 설명 |
|---|---|
| 스케일 | 신체 특성에 대한 숫자 값 height, width, head, body type 및 proportion. 이는 R6 신체 유형에는 영향을 미치지 않습니다. |
| 액세서리 | 캐릭터가 장착한 accessories의 자산 ID입니다. |
| 클래식 의류 | 캐릭터에 적용할 수 있는 Shirt, Pants, 및 ShirtGraphic 이미지 텍스처의 자산 ID입니다. |
| 신체 부위 | 캐릭터의 Face, Head, Torso, RightArm, LeftArm, RightLeg 및 LeftLeg 부위의 자산 ID입니다. |
| 신체 색상 | 캐릭터의 개별 부위의 BodyColors입니다. |
| 애니메이션 | 캐릭터에서 사용할 수 있는 Animations의 자산 ID입니다. |
다음 단계를 사용하여 HumanoidDescription으로 캐릭터를 사용자 정의하세요:
HumanoidDescription 생성
다음 코드를 사용하여 Explorer 계층 내에서 또는 Script 내에서 새 HumanoidDescription 인스턴스를 직접 생성할 수 있습니다:
local humanoidDescription = Instance.new("HumanoidDescription")대부분의 경우, 기존 플레이어 캐릭터, 아바타 의상 또는 사용자 ID를 참조하여 기본 새 HumanoidDescription 대신 기존 HumanoidDescription을 사용하는 것이 좋습니다.
플레이어 캐릭터에서
다음 코드 샘플을 사용하여 플레이어 캐릭터의 현재 속성을 기반으로 새 HumanoidDescription을 생성합니다:
local humanoid = player.Character and player.Character:FindFirstChildWhichIsA("Humanoid")
local humanoidDescription = Instance.new("HumanoidDescription")
if humanoid then
humanoidDescription = humanoid:GetAppliedDescription()
end기존 의상에서
다음 샘플 코드를 사용하여 Players.GetHumanoidDescriptionFromOutfitID를 사용하여 의상 ID에서 HumanoidDescription을 생성합니다:
local Players = game:GetService("Players")
local outfitId = 480059254
local humanoidDescriptionFromOutfit = Players:GetHumanoidDescriptionFromOutfitId(outfitId)특정 사용자에서
다음 샘플 코드를 사용하여 Players:GetHumanoidDescriptionFromUserId()를 사용하여 사용자 ID에서 HumanoidDescription을 생성합니다:
local Players = game:GetService("Players")
local userId = 491243243
local humanoidDescriptionFromUser = Players:GetHumanoidDescriptionFromUserId(userId)HumanoidDescription 수정
HumanoidDescription 속성을 사용자 정의하려면, HumanoidDescription에 직접 설정하거나 HumanoidDescription을 캐릭터에 적용하기 전에 지정된 메서드를 사용하세요.
다음 코드 샘플은 다양한 유형의 HumanoidDescription 속성을 설정하는 예를 제공합니다:
local humanoidDescription = Instance.new("HumanoidDescription")
humanoidDescription.HatAccessory = "2551510151,2535600138"
humanoidDescription.BodyTypeScale = 0.1
humanoidDescription.ClimbAnimation = 619521311
humanoidDescription.Face = 86487700
humanoidDescription.GraphicTShirt = 1711661
humanoidDescription.HeadColor = Color3.new(0, 1, 0)여러 액세서리 설정
레이어드 또는 대량 액세서리 변경을 위해 HumanoidDescription:SetAccessories()를 사용하여 액세서리 관련 업데이트를 수행할 수 있습니다. 다음 코드 샘플은 레이어드 스웨터와 재킷을 순서대로 HumanoidDescription에 추가합니다:
local humanoidDescription = Instance.new("HumanoidDescription")
local accessoryTable = {
{
Order = 1,
AssetId = 6984769289,
AccessoryType = Enum.AccessoryType.Sweater
},
{
Order = 2,
AssetId = 6984767443,
AccessoryType = Enum.AccessoryType.Jacket
}
}
humanoidDescription:SetAccessories(accessoryTable, false)HumanoidDescription 적용
Humanoid:ApplyDescription() 또는 Humanoid.LoadCharacterWithHumanoidDescription를 사용하여 게임 내 특정 Humanoid 캐릭터에 HumanoidDescription을 적용하세요.
단일 캐릭터에
ApplyDescription()은 모든 Humanoid를 대상으로 할 수 있습니다. 다음 코드를 사용하여 플레이어 캐릭터에 새로운 선글라스와 새로운 몸통을 추가합니다:
local humanoid = player.Character and player.Character:FindFirstChildWhichIsA("Humanoid")
if humanoid then
local descriptionClone = humanoid:GetAppliedDescription()
descriptionClone.Torso = 86500008
-- 여러 얼굴 액세서리 자산은 쉼표로 구분된 문자열로 허용됩니다
descriptionClone.FaceAccessory = descriptionClone.FaceAccessory .. ",2535420239"
-- 수정된 "descriptionClone"을 humanoid에 적용
humanoid:ApplyDescription(descriptionClone)
end모든 플레이어 캐릭터에
다음 샘플 코드를 사용하여 게임 내 모든 현재 플레이어에게 HumanoidDescription을 적용합니다:
local Players = game:GetService("Players")
for _, player in Players:GetPlayers() do
local humanoid = player.Character and player.Character:FindFirstChildWhichIsA("Humanoid")
if humanoid then
-- HumanoidDescription 생성
local humanoidDescription = Instance.new("HumanoidDescription")
humanoidDescription.HatAccessory = "2551510151,2535600138"
humanoidDescription.BodyTypeScale = 0.1
humanoidDescription.ClimbAnimation = 619521311
humanoidDescription.Face = 86487700
humanoidDescription.GraphicTShirt = 1711661
humanoidDescription.HeadColor = Color3.new(0, 1, 0)
humanoid:ApplyDescription(humanoidDescription)
end
end모든 생성 캐릭터에
다음 샘플 코드를 사용하여 모든 생성 플레이어 캐릭터에 특정 HumanoidDescription을 설정합니다:
local Players = game:GetService("Players")
-- 자동 생성을 중지하여 "PlayerAdded" 콜백에서 수행할 수 있도록 합니다
Players.CharacterAutoLoads = false
local function onPlayerAdded(player)
-- HumanoidDescription 생성
local humanoidDescription = Instance.new("HumanoidDescription")
humanoidDescription.HatAccessory = "2551510151,2535600138"
humanoidDescription.BodyTypeScale = 0.1
humanoidDescription.ClimbAnimation = 619521311
humanoidDescription.Face = 86487700
humanoidDescription.GraphicTShirt = 1711661
humanoidDescription.HeadColor = Color3.new(0, 1, 0)
-- HumanoidDescription으로 캐릭터 생성
player:LoadCharacterWithHumanoidDescription(humanoidDescription)
end
-- "PlayerAdded" 이벤트를 "onPlayerAdded()" 함수에 연결
Players.PlayerAdded:Connect(onPlayerAdded)HumanoidDescription 인스턴스가 Explorer에서 생성되어 작업 공간에 부모로 설정된 경우, 다음 샘플 코드를 Script에서 사용하여 작업 공간 인스턴스에 접근합니다:
local Players = game:GetService("Players")
-- 자동 생성을 중지하여 "PlayerAdded" 콜백에서 수행할 수 있도록 합니다
Players.CharacterAutoLoads = false
local function onPlayerAdded(player)
-- "workspace.StudioHumanoidDescription"으로 캐릭터 생성
player:LoadCharacterWithHumanoidDescription(workspace.StudioHumanoidDescription)
end
-- "PlayerAdded" 이벤트를 "onPlayerAdded()" 함수에 연결
Players.PlayerAdded:Connect(onPlayerAdded)비 R15의 레이어드 액세서리
레이어드 액세서리와 같은 케이지 액세서리는 WrapTarget 및 WrapLayer를 사용하여 대상 Model 위에 늘리거나 감쌉니다. 레이어드 액세서리는 표준 플레이어 캐릭터와 비 R15 모델 모두에서 작동할 수 있습니다.
고유한 케이지 UV 맵을 사용하는 모델과 같은 레이어드 액세서리의 사용자 정의 구현은 마켓플레이스에 업로드하거나 게시할 수 없습니다. 자세한 내용은 레이어드 액세서리 사양을 참조하세요.
아바타 R15 리그에서 레이어드 액세서리를 구현하든, 사용자 정의 리그를 사용하든, 액세서리와 본체가 다음을 포함하는지 확인하세요:
- 대상 모델, 일반적으로 본체는 추가 모델이 감싸도록 의도된 메쉬에 WrapTarget 구성 요소가 있어야 합니다.
- 레이어링 모델, 일반적으로 의류 또는 액세서리는 대상 모델을 감싸도록 의도된 메쉬에 WrapLayer 구성 요소가 있어야 합니다.
- 대상 모델의 외부 케이지와 레이어링 모델의 내부 및 외부 케이지는 일치하는 UV 맵을 가져야 합니다.
- 대상 케이지의 해당 정점은 레이어 케이지의 해당 정점과 동일한 UV를 가져야 합니다.
- 대상 모델이 R15이고 Humanoid를 포함하는 경우, 이 용접은 자동으로 생성됩니다.