naverz / zepeto-script-sample

38 stars 7 forks source link

제페토 캐릭터 애니메이션 수정 관련 #65

Closed Restnextsnak closed 2 years ago

Restnextsnak commented 2 years ago

제페토에서 제공하는 캐릭터의 애니메이션을 만들어서 넣거나 수정하려면 어떻게 해야하죠?

moondory77-naverz commented 2 years ago

안녕하세요. 제페토 캐릭터 컨트롤러 모듈에서, 임의의 캐릭터 애니메이션 클립을 만들어 적용하는 방법은 다음과 같습니다.

  1. Project 창에서 ZEPETO.Character.Controller/Runtime/_Resources/AnimatorController/ZepetoAnimator.controller 파일을 로컬 환경의 Assets/~ 경로로 드래그 이동합니다. (해당 에셋이 복사됩니다.)
1 animator 에셋복사
  1. Hierachy 창의 ZepetoPlayers 오브젝트를 선택한 다음, Inspector 창의 [Player >> Animator Controller] 탭에 복사해온 ZepetoAnimator.controller를 지정합니다.
1 animator 커스텀지정
  1. 해당 animation controller를 연 다음, state machine에 지정되어 있는 각각의 state에 대한 animation clip을 변경할 수 있습니다. 3 커스텀clip지정
moondory77-naverz commented 2 years ago

또한, ZepetoAnimator.controller의 animation state machine에는, 임의의 클립을 지정한다음, 필요할 때마다 해당 animation event를 invoke 할 수 있도록 사전에 지정된 state 슬롯(Gesture)를 제공하고 있습니다.

3 Gesture_Custom

스크립트에서 ZepetoCharacter 인스턴스에 대해, Gesture Event에 임의의 animation clip을 적용하여 Play/Stop 할 수 있습니다.

[Usage-ts]

public character : ZepetoCharacter; public customClip:AnimationClip;
...
character.SetGesture(customClip); character.CancelGesture(); ...