Making a button to Teleport another player inworld

Hey- I’m working on a experimental VRC world.
I need to create a function where when i press a button in one room
it teleports another player from A to B.
This is the current Graph i have- I’m unsure what i can do inorder to make it work.

Thanks in advance!

Unfortunately you won’t be able to teleport another player this way. Before I explain that, I’ll mention that you haven’t connected the execution arrows from OnPlayerTriggerStay, which means that variable isn’t getting set.

However, even if you did set that variable, the teleport wouldn’t work because the TeleportTo node can only be called by the local player.

The only way to successfully initiate a teleport from another person is to essentially set up a system where you send a signal to all players that they should teleport, but ignore the signal unless the local player is uniquely identified as the player you want to teleport.

Unfortunately the way TeleportTo is presented is misleading in this regard. Please upvote this canny request: Canny

1 Like

Thanks.
Would one be able to make a teleport trigger tho?
Like a checkpoint? So when the player touches it they would teleport.

If that was an option i could just make a button that would move into the room and force the player onto the trigger.

Yes, just use OnPlayerTriggerEnter. However, you should almost always use a Branch node with OnPlayerTriggerEnter to read the VRCPlayerApi output and stop the execution if that player is not the local player. Otherwise, any player entering the trigger would cause every player to run the code.

1 Like

Thank you- I will give this a try and post the resault if it works.
atleast as a “workaround”.