CREATE YOUR WORLD
Portal
Inter-world movement API
2min
you can only move between worlds that has passed the review and has been activated you will not enter the secret room of the target world zepetoworldcontent must be imported to use the inter world movement api import { zepetoworldcontent } from 'zepeto world'; the function definitions are as follows api description public static movetoworld($worldid string, $onerror system action$2\<number, string>)\ void; after the world id text is set as a parameter, the inter world movement is executed when the function is called \ if it is a world that cannot be moved to, an error occurs and can be controlled through callback in case of an error below is a code sample that moves you to another world when you enter a specific gameobject trigger movetoworld import { zepetoscriptbehaviour } from 'zepeto script'; import { zepetoworldcontent } from 'zepeto world'; import { collider,vector3,quaternion } from 'unityengine'; import { zepetocharacter, zepetoplayer, zepetoplayers } from 'zepeto character controller'; export default class movetoworld extends zepetoscriptbehaviour { private zepetocharacter zepetocharacter; // ex com default jumpworld private worldid string = "world id"; start() { zepetoplayers instance onaddedlocalplayer addlistener(() => { this zepetocharacter = zepetoplayers instance localplayer zepetoplayer character; }); } ontriggerenter(collider collider) { if ((this zepetocharacter == null) || (collider gameobject != this zepetocharacter gameobject)) { return; } zepetoworldcontent movetoworld(this worldid, (errcode, errmsg) => { // example of error callback processing // (when implementing,try to implement it in various ways, such as pop up windows) console log(`${errcode} ${errmsg}`); }); } }