Sansar Docs
  • 🚀Welcome to Sansar
  • 📚GLOSSARY
  • 🎏Patch Notes
  • 😇Work in Progress
  • ⚠️Creative Commons License
  • Support
    • General Troubleshooting
      • General FAQ
      • The Sansar Cache
      • The Sansar Log
    • Contact Support
  • Sansar Basics
    • Installation And Compatibility
      • Installing Sansar
      • System Requirements
      • Sansar Compatibility FAQ
      • Sansar on Mac
      • Body Tracking Vive
      • Configuring Firewalls
    • Account Management
      • Account Set Up
      • Avatar Name and ID
      • Adding Payment Method
      • Discord FAQ
      • Steam Integration
      • Subscription FAQ
    • Controls
      • Avatar Hand Gestures in VR
      • FreeCam and CineCam
      • Game Controller Buttons
      • HTC VIVE controls
      • Keyboard Shortcuts for Editing a Scene
      • Keyboard Shortcuts for Styling Your Avatar
      • Keyboard Shortcuts for Visiting an Experience
      • Mouselook Mode
      • Oculus Rift Controls
      • Vive Index Controls
    • Settings
      • General Settings
    • VR Settings
      • VR Settings Menu
      • Calibrating Height in VR
  • Exploring in Sansar
    • Navigate and Explore
      • The Codex
      • Instances
      • Interactive objects
      • The Main Menu
      • The Nexus
      • Portals
      • Quests
      • Quick Start: Exploring in Sansar
    • Socialize And Connect
      • Chat Panel
      • Experience Points, Levels, and Titles.
      • Finding People in Sansar
      • Identifying Interacting With Avatars
      • The People panel
      • User profiles
    • Attending events
      • Deploying Unpublished Event to Event World
      • Adding Events to Your Calendar
      • Attending Events in Sansar
      • Avatar Broadcasting FAQ
      • Creating Your Own Events
      • Redemption Codes
      • Tipping
    • Share Content
      • Streaming Sansar
      • Taking a photo
  • Avatar Creation
    • Avatar Basics
      • Avatar 2.0 FAQ
      • Customizing Your Avatar
      • Avatar Emotes
      • The Avatar Editor
    • Dressing The Avatar
      • Fitting Designer Clothing to your Avatar
      • Setting Custom Emotes
      • Wearing Accessories
      • Wearing Rigged Clothing
    • Managing Avatar Items
      • Importing Avatar-Related Items
      • Editing an inventory item's name
      • Editing an inventory item's image
      • Deleting avatar looks from your inventory
      • Importing a custom emote animation
      • Managing your avatar looks inventory items
    • Avatar Resources
      • Avatar Reference Files
      • Blender - Avatar files
      • Blender - Using Decimate Tool
      • Exporting Custom Avatars From Blender
      • Sansar Skeleton Skinning Details
      • Using Animation Skeleton
  • Creating In Sansar
    • Importing Things to Sansar
      • Supported file types
      • AABB Bounding Box and Item Restrictions
      • Importing Audio
      • Importing a Custom Avatar
      • Importing World Items
      • Importing Collision Volumes
      • Importing Accessories
      • Importing Clothing
      • Importing Emotes
      • Importing Hair
      • Importing Custom Scripts
      • Importing a Skybox
      • Troubleshooting Import Errors
    • Shaders and Materials
      • Shaders Information
      • Materials Information
      • VAT Shader Guides
        • VAT Shader Basics
        • VAT Technical Info
      • Displacement Guides
        • Simple Displacement
        • Advanced Displacement
    • Marvelous Designer Info
      • Marvelous Designer Integration
      • Marvelous Designer Creator Resources
      • Marvelous Import and Export
      • MD Limitations
    • Shader Scripting
    • Materials editing and shaders
    • Creator Tools
      • Creating a World
      • Creating Quests
      • Diagnostics Toolbar
      • Importing Items to Sansar
      • My Worlds Panel
    • Managing Worlds
      • Quick start: Creating experiences in Sansar
      • Deleting an experience or scene
      • Deploying a new scene to an existing experience
      • Editing a scene
      • Experience memos
      • Linking A Scene To A World
      • Managing your scenes and worlds
      • Moderation Tools for World Owners
      • Publishing Options for Your Experiences
      • Renaming a scene
      • Saving and Building A Scene
      • Sharing Your Experiences
      • Visiting your own experience
    • Part Of The World Editor
      • Object Stats Toolbar
      • Object Components
      • Parenting objects
      • Scene Item Inventory
      • Scene Objects Panel
      • Collision Volumes
      • Scene Settings
      • System objects
      • Object Motion Types
    • Working With Scripts
      • Working With Scripts
      • Working With Trigger Volume
      • Referencing Scene Components
      • Intro to Scripting in Sansar
      • Using the Script Console
      • Setting Script Parameters
      • Adding Scripts to an Object
      • Configuring Teleport Scripts
      • Simple Script User Guide
    • Working With Audio and Video
      • Working With Audio
      • Creating Media surface
      • Streaming Web Audio
      • Audio Emitter
      • Sansar Audio FAQ
      • Using Media Streams
      • Ambisonic Sounds
      • High Quality Spacial Audio
      • Audio Resource - Room Tones
      • Previewing Audio and Video in a Scene
      • Using Audio Materials
    • Working With Lights
      • Working With Lights
      • Light Types
      • Global Illumination
  • Sansar Store
    • Using the Sansar Store
      • The Sansar Store
      • Buying Items From The Store
      • Redelivering Lost Purchases
    • Buying and Selling Sansar Dollars
      • Gifting Sansar Dollars
      • Buying Sansar Dollars
      • Converting Sansar Dollars
      • Processing US Dollar Credit
    • Selling Your Content
      • Hidden Store Listings
      • Selling Items in Sansar Store
      • Selling Items in an Experience
      • Allowing Resale Of Items
      • Buyers Permissions
  • Guidelines and Moderation
    • Guidelines and Policies
      • Terms of service
      • Sansar's Discord Server Rules
      • Community Standards
      • Content Guidelines
      • World Publishing Guidelines
      • Store Listing Guidelines
      • Store Banner Guidelines
      • Event Guidelines
      • Privacy Policy
      • Sansar Freeware License Agreement
      • Intellectual Property Infringement Notification
      • Cookie Policy
    • Moderation and Reporting
      • Abuse and Griefing
      • Blocking Avatars
      • Muting Avatars
      • Reporting abuse
      • Reporting issues and bugs
      • Security issues
  • Script API Docs
    • General Information
      • External Script Repository's
      • Sansar Script API
      • Script API Updates
      • Restricted API's
    • Example Scripts
      • Example Scripts in Sansar
      • Cannonball
      • Follow The Path
      • Random Movement
      • Reflective Detector
      • Simple Script
      • Sound Randomizer
      • Stats Example
      • Teleport Hotkeys
      • Visitor Tracker
      • Mover Examples
    • Sansar Namespace
      • Namespace
      • Color
      • Mathf
      • Quarterion
      • Vector
      • Vector Extensions
    • Sansar.Script Namespace
      • AddEntryAttribute
      • CancelData
      • ComponentID
      • CoroutineException
      • Default Attributes
      • Editor Visible Attribute
      • Entries Attribute
      • Event Data
      • ICoroutine
      • IEvent Subscription
      • Instance Interface
      • Locked Attribute
      • Log
      • MaxEntriesAttribute
      • Memory
      • MinEntriesAttribute
      • NonReflectiveAttribute
      • ObjectID
      • OperationCompleteEvent
      • RangeAttribute
      • Reflective
      • Script.Base
      • Script Event Data
      • Script Handle
      • ScriptID
      • SessionID
      • Simple Script Event Data
      • ThrottleException
      • Timer
      • Tooltip Attribute
    • MetaData Namespace
      • Assembly MetaData
      • Script MetaData
    • Sansar Script Testing Namespace
      • Assertion Failure Exception
      • Assertions
    • Sansar Utility Namespace
      • GenericEnumerable <T>
      • GenericEnumerable<T>.GetItem
      • JSON Serialization Data
      • JSON Serialization Data 1
      • JSON Serializer
      • JSON Serializer Options
    • Sansar Simulation Namespace
      • Agent Info
      • Animation
      • Audio Component
      • Camera Control Mode
      • Character Tracker
      • Chat
      • Client
      • Cluster
      • Command Action and Data
      • Component Type
      • Control Point Type
      • Held Object
      • HTTP
      • Interaction
      • Light
      • Media Action
      • Mesh Component
      • Modal Dialogue
      • Move Mode and Mover
      • Objective
      • PlayHandle
      • PlaySettings
      • PlayStatus
      • Quest
      • RayCastHit
      • Rigid Body
      • Scene
      • Scene Public
      • Simple Script
      • Sit Event Type
      • Sit Object Data
      • Sound Resource
      • Stream Channel
      • Tutorial Hint
      • UI
      • User Data
Powered by GitBook
On this page
  1. Script API Docs
  2. Example Scripts

Teleport Hotkeys

Example Script: Teleport Hotkeys

PreviousStats ExampleNextVisitor Tracker

Last updated 1 year ago

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:

  1. Download the script file from the download link at the end of this article.

  2. Follow the instructions provided in to upload the script and add it to an object.

  3. Open the object's Properties panel and go to the Script Settings section.

  4. 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.

  5. Set a TeleportHotkey that will be used to trigger the script.

  6. 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.

  7. 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.

  8. Once you have finished setting the parameters for your object, your script is ready! Save and build your scene.

  9. 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

  • Key_W

  • Key_A

  • Key_S

  • Key_D

  • Key_Space

  • Key_F

  • Key_1

  • Key_2

  • Key_3

  • Key_4

  • Key_5

  • Key_6

  • Key_7

  • Key_8

  • Key_9

  • Key_0

  • Key_F1

  • Key_F2

  • Key_F3

  • Key_F4

  • Key_F5

  • Key_F6

  • Key_F7

  • Key_F8

  • Key_F9

  • Key_F10

  • Key_F11

  • Key_F12

Gamepad Buttons

  • Gamepad_DpadUp

  • Gamepad_DpadDown

  • Gamepad_DpadLeft

  • Gamepad_DpadRight

  • Gamepad_SmallLeft // Xbox: Back, PS: Select

  • Gamepad_SmallRight // Xbox: Start, PS: Start

  • Gamepad_LeftThumb

  • Gamepad_RightThumb

  • Gamepad_LeftShoulder

  • Gamepad_RightShoulder

  • Gamepad_ButtonLeft // Xbox: X, PS: Square

  • Gamepad_ButtonTop // Xbox: Y, PS: Triangle

  • Gamepad_ButtonRight // Xbox: B, PS: Circle

  • Gamepad_ButtonBottom // Xbox: A, PS: X

  • Gamepad_Extra1

  • Gamepad_Extra2

Have more questions? Join our

Working with scripts
Creative Commons License
Discord!
teleportexample.png
teleport_target.png