CREATE YOUR WORLD
Players & Characters : Advance...
ZEPETO 캐릭터를 기본 체형으로 변경하는 API
6min
zepeto 아바타가 월드 에 들어갈 때 신체 수정 아이템을 착용하거나 지나치게 크거나 작은 신체 형태를 선택하면, 게임 플레이에 방해가 될 수 있습니다 이 가이드에서 소개된 api를 사용하면 zepeto 캐릭터를 기본 신체 형태로 되돌릴 수 있습니다 ❗️ 주의 zepeto character controller 패키지는 버전 1 11 1 이상에서 사용할 수 있습니다 api 설명 getbodymodifierproperties() zepeto 캐릭터가 어떤 신체 수정 아이템을 착용하고 있는지에 대한 정보를 반환합니다 deformdefaultproperties() 이 api는 zepeto 캐릭터가 착용한 신체 수정 아이템을 제거하고 기본 신체 형태로 되돌립니다 deformdefaultcostume() 이 api는 zepeto 캐릭터가 착용한 신체 수정 아이템을 제거하고 기본 신체 형태로 되돌리며 기본 zepeto 의상으로 입힙니다 \ 또한 zepeto 플레이어 수준에서도 적용할 수 있습니다 이 경우, 멀티플레이어 월드 에 들어가는 모든 zepeto 플레이어는 신체 수정 아이템이 제거되고 기본 zepeto 의상으로 입혀집니다 zepetopropertyflag enum none = 0, skin = 1, skintone = 2, skindetail = 3, face = 4, eye = 5, eyelens = 6, eyebrow = 7, beard = 8, mustache = 9, eyeshadow = 10, eyeliner = 11, eyelash = 12, blusher = 13, nose = 14, mouth = 15, lips = 16, hair = 17, clothesglasses = 18, clothestop = 19, clothesbottom = 20, clothesshoes = 21, clothesdress = 22, background = 23, roomwallpaper = 24, roomfloor = 25, roombottom = 26, roomtopleft = 27, roomtopright = 28, roommiddleleft = 29, roommiddleright = 30, point = 31, freckles = 32, facehair = 33, doubleeyelid = 34, nailart = 35, clothessocks = 36, clothesglove = 37, accessorybracelet = 38, accessorynecklace = 39, accessoryearring = 40, accessoryring = 41, accessoryheadwear = 42, accessorypiercing = 43, boothbackground = 44, lut = 45, accessorymask = 46, facepainting = 47, accessorybag = 48, accessorywing = 49, clothescape = 50, clothesextra = 51, mannequinface = 52, wrinkleforehead = 53, wrinkleeye = 54, wrinklemouth = 55, doubleeyelidbottom = 56, wrinklemongo = 57, accessorytail = 58, accessoryeffect = 59, clothesdeform = 60, hairextensions = 61, makeupset = 62, facecontouring = 63, basemodel = 64, creatorlens = 65, basedeform = 66 예제 스크립트 다음 예제 스크립트를 참조하십시오 import { zepetoscriptbehaviour } from 'zepeto script'; import { zepetocharacter, localplayer, zepetoplayers } from 'zepeto character controller'; import { zepetopropertyflag } from 'zepeto'; export default class deform extends zepetoscriptbehaviour { private localplayer localplayer; private itemproperties zepetopropertyflag\[] start() { zepetoplayers instance onaddedlocalplayer addlistener(() => { this localplayer = zepetoplayers instance localplayer; // 1 로컬 캐릭터 몸체 형태 변경 아이템이 장착된 위치를 출력하는 코드 this itemproperties = this localplayer zepetoplayer character getbodymodifierproperties(); console log(this itemproperties); // 2 로컬 캐릭터 몸체 형태 변경 아이템을 해제하는 코드 this localplayer zepetoplayer character deformdefaultproperties(); // 3 로컬 캐릭터 몸체 형태 변경 아이템을 해제하고 기본 의상을 입히는 코드 this localplayer zepetoplayer character deformdefaultcostume(); }); // 4 모든 플레이어의 몸체 형태 변경 아이템을 해제하고 기본 의상을 입히는 코드 zepetoplayers instance onaddedplayer addlistener(() => { zepetoplayers instance deformdefaultcostume(); }); } } 스크립트 설명 1\) 로컬 플레이어가 착용한 몸체 수정 아이템 슬롯 정보는 this itemproperties 에 저장되며 getbodymodifierproperties() 를 통해 해당 정보가 콘솔에 출력됩니다 2\) 로컬 플레이어가 착용한 모든 신체 수정 아이템은 deformdefaultproperties() , 그리고 캐릭터는 기본 신체 형태로 변경됩니다 3\) deformdefaultcostume() , 로컬 플레이어가 착용한 모든 신체 수정 아이템은 제거되며, 기본 zepeto 의상을 착용한 모습으로 변경됩니다 4\) 아래 코드는 월드 에 들어오는 모든 플레이어의 모든 신체 수정 아이템이 제거되고 기본 zepeto 의상을 입게 됨을 보장합니다 그러나 멀티플레이어 설정 및 기본 서버 클라이언트 스크립트 구현은 미리 완료되어야 합니다 zepetoplayers instance onaddedplayer addlistener(() => { 	zepetoplayers instance deformdefaultcostume(); }); 애니메이션 아바타 얼굴도 신체 수정 아이템으로 분류됩니다 따라서, deformdefaultproperties() , deformdefaultcostume() api를 사용할 때, 월드 에 들어오는 애니메이션 아바타의 외모도 변경될 것임을 유의하시기 바랍니다