CREATE YOUR WORLD
Players & Characters: Advanced

Teleport Implementation

9min

Implements a portal through which the ZEPETO character can teleport to two different points.



Document image




STEP 1 : Setting the teleport target point



  • Implement the ZEPETO character creation code in Scene as a default.

📘 Please refer to the following guide. [Create a ZEPETO Character]



1) Create points to teleport to.

  • For this guide, we will refer to them as A and B points.
  • Create a Hierarchy > 3D Object > Plane, and rename it to Plane_A.
Document image




2) Add a Portal object that will initiate a teleport.

  • Be sure to add a Collider to interact with the object.
    • Adjust the size of the area to detect collisions.
    • Make sure to check Is Trigger.
Document image




3) Create a total of 2 teleportation points in the same way.

Example of Teleport Point A
Example of Teleport Point A




Example of Teleport Point B
Example of Teleport Point B




  • Adjust the Position so that the points do not overlap.
Document image




STEP 2 : Write a script



1) Create a Project > Create > ZEPETO > TypeScript and rename it to Teleport.

2) Write a sample script like below.

  • Logic to teleport with destinationObject when a collision with a ZEPETO character is detected in the collider area of the object to which the script is attached.
TypeScript




3) After you finish writing the script, add the script to the Portal object that will initiate the teleport.

4) In the inspector, assign the Destination Object.

  • Destination Object : a portal object to arrive at the end of the teleport.
Document image




STEP 3 : Run



Teleport the ZEPETO character from point A to point B when it is near the portal.

Document image




  • This guide only handles teleporting of Local Players that I manipulate.
  • In the case of multiplayer worlds, synchronization of the location of other players is additionally required.
  • Using the synchronization component of the multiplayer sample, position synchronization is easy to implement.