Teleport Hotkeys
Example Script: Teleport Hotkeys
This example script, Teleport Hotkeys (TeleportHotkeys.cs), allows you to set hotkeys that teleport users to another experience when pressed.
Instructions
Here is a step-by-step guide to using the script:
Download the script file from the download link at the end of this article.
Follow the instructions provided in Working with scripts to upload the script and add it to an object.
Open the object's Properties panel and go to the Script Settings section.
Upon looking at the Script Settings section for TeleportHotkeys, you will see a list of parameters which you can set for the object. Setting values on these parameters can help you set the teleport hotkey and experience destination. See the section on Script Parameters for a full listing of parameters.
Set a TeleportHotkey that will be used to trigger the script.
To grab the experience name and Avatar ID of the experience that you want as a teleport location, go to the details page of the the experience that you want to designate.
Once you are on the experience details page, click Copy URL on the bottom left corner of the details page. This opens a new window which shows the experience's URL, where you can copy the Experience name and the creator's Avatar ID (Persona Handle) as seen below.
Access the experience URL to access the Avatar ID (aka Persona Handle) and Experience name.
Once you have finished setting the parameters for your object, your script is ready! Save and build your scene.
If you want to verify that the script is running correctly, visit the scene once it has been built.
Script parameters
TeleportHotkey | Designate a hotkey that will trigger the teleport script to run and transfer the user to the designated experience. You can choose from the list of keyboard and gamepad buttons below. |
Experiences | Designate the name of the designated experience that you want your users to teleport to when the TeleportHotkey is triggered. |
PersonaHandle | To properly direct your users to the correct experience, you must also grab the creator's Avatar ID (aka Persona Handle) from the Experience's URL. |
Parameters for TeleportHotkey
Keyboard Buttons |
|
|
|
|
Gamepad Buttons |
|
|
Have more questions? Join our Discord!
Last updated