CREATE YOUR WORLD
Players & Characters: Tips

Get the current location of the ZEPETO character

5min

This guide will show you how to check the current location of a local player's ZEPETO character within ZEPETO World.

The location information is stored in the transform object's position, so it is important to access the ZEPETO player's transform to find their location.



STEP 1 : Writing the Script

  • Select the [+] menu in the top left corner of the [Project] panel or choose Assets > Create > ZEPETO > TypeScript.
  • Rename the added script to GetPosition and write a sample script as follows.
GetPosition


❗️ Caution To use the GetPlayer() function in a multiplayer environment, you must use sessionId as a parameter.



📘 Please refer to the following guide. [ZEPETO Players]



  • Add a GameObject to the Scene and rename it to CharacterPosition.
    • Add the written GetPosition ZEPETOScript, and connect a Button UI to the Property in the ZEPETO Script Inspector window by simply dragging and dropping it from the Hierarchy window.
Document image




STEP 2 : Run

  • When you press the Play button, you can check the character's real-time location through the Text UI.
Document image