| sinespace

Clickable Teleporter

Jump to: navigation, search

This tutorial will show you how to turn an object into a clickable teleporter that you can use so visitors can transport to another region in SineSpace with the click of a button.

Find and select an object to turn into a clickable teleporter

First, in the Unity Editor you need to select an object to add the functionality to. This can either be an object in a scene, or an object that will be uploaded as furniture. The example shows a simple sign that has been created as furniture.


Add the Scripting Runtime component

After selecting the object, in the Inspector panel click on the Add Component button and start typing 'Scripting Runtime' - as you type, you will see search results and can click once you see it.


Enter the script

Copy and Paste in the code below into the Scripting Runtime component

regionID = 15
coordinates = Vector.New(0,100,0)
rotation = Quaternion.Euler(0,15,0)
function activate() 
    Space.Scene.PlayerAvatar.Teleport(regionID, coordinates, rotation)


After you've pasted in the text, replace the regionID in the top line with your destination's regionID. If the destination is your build, you can find the region ID on the Curator site's Items page, on the listing for that region. If the destination is someone else's build, you will need to talk to the region owner to get their permission and the region ID (as well as the coordinates below).

The coordinates and rotation values (lines 2 and 3 of the above script) is where you want the avatar to arrive in your region. If you are not sure what to use, enter the transform coordinates from your region's main landmark.


Once you've entered the coordinates, change the dropdown setting for Index to Legacy.

Add the Clickable Activator component

Now that the script is ready, you add a Clickable Activator to call it. Click the Add Component button and start typing 'clickable' and you should see it appear in the search results


To configure the component, first you need to drag your GameObject from the scene hierarchy into the Object slot. Once you do that, you will be able to set the rest of the On Click Event () section up as pictured below. Enter whatever you like in the Tooltip section, this will display to users when they hover over your object in-world.


Upload and test in-world

Finish and upload your region or furniture item and test it on the preview grid. The clickable object should highlight when you hover your pointer over it, and then clicking should transport you to your destination.