CREATE YOUR WORLD
Players & Characters: Tips

Measuring your character's height

4min

In this guide, we will show you how to measure the height of a local player's ZEPETO character according to the body type.



STEP 1 : Write a script to get the height value of the character

Add a GameObject to the Scene and add the CharacterHeight example script below.

TypeScript




Script Description

  • *CoGetZepetoHeight(zepeto: ZepetoPlayer)
    • Use GetSocket to get the character's head socket position value.
    • To obtain the position value of the bottom center of the character, use GetBoneTransform to obtain the position value of both feet of the character.
    • Use Vector3.Lerp to get the character's bottom center position value.
    • Obtain the character's Height value using the character's head socket and the center bottom position value.



STEP 2 : Run

When you run it by clicking the Play button, you can see the character's Height value in the console log.

Document image




👍 TIP

  • The way to measure the height in the example is to measure the character's height using the height value of the HeadSocket.
  • If you would like to measure the top position by modeling the character's head, hat, and accessories, please refer to the following link :