If you want to give visitors in your Jibe world the ability to instantly “teleport” from one location to another, you can easily set that up too. Today we’ll learn how to set up any object in your Jibe world so that, if you click on it, your avatar is instantly teleported from one place to another.
If you’re a current Jibe customer, you’ll find a detailed section in the Jibe User Manual and Developer Reference (downloadable here) that explains how to set up “Teleport Links.” This gives you the ability to add buttons on the Jibe User Interface that will teleport avatars to any locations you wish to define.
But what if you want to create an inworld object like a sign or a door that, when an avatar clicks on it, automatically teleports them somewhere?
Here’s how you can set it up in a few simple steps.
- Step 1: Create a New Script
Fire up your Unity editor and create a new C# script.
Name this script “ClickObjectTeleport” and double-click on it in your Project window to start editing it.
Paste the following code into your new ClickObjectTeleport script.
public class ClickObjectTeleport : MonoBehaviour
public int spawnVariance = 0;
private static System.Random random = new System.Random();
public bool showTeleportParticleEffect = true;
public GameObject teleportParticleGenerator;
public Transform teleportDestination;
void DoTeleport(Transform target)
string localPlayerName = “localPlayer”;
GameObject localPlayer = GameObject.Find(localPlayerName);
float offsetX = random.Next(spawnVariance);
float offsetZ = random.Next(spawnVariance);
Vector3 newPosition = target.position;
newPosition.x = target.position.x + offsetX;
newPosition.z = target.position.z + offsetZ;
localPlayer.transform.position = newPosition;
localPlayer.transform.rotation = target.rotation;
if (teleportParticleGenerator != null)
Instantiate(teleportParticleGenerator, newPosition, target.rotation);
- Step 2: Put your script inside an object
You can place your ClickObjectTeleport script inside any object in your Jibe world that you want to use as a clickable teleportation device. Let’s use a cube for this example.
Now, go to your Project window and drag your ClickObjectTeleport script into your cube object.
Find a copy PlayerParticles in your Project folder and drag it onto the Teleport Particle Generator field in the Inspector settings. This will generate a nice particle effect when avatars teleport.
The last thing you need to add is the Teleport Destination. We’ll do that in the next step.
- Step 3: Set up a Teleport Destination
Find the location where you want an avatar to arrive when they teleport and create an empty GameObject at the precise point you want the avatar to appear.
Rename your empty GameObject something like Teleport arrival point so you can easily find it in your Hierarchy window. Remember, it will be invisible in your scene!
Now go back and select the teleporter cube you created, go into the Inspector window, and drag your Teleport arrival point object from your Hierarchy onto the Teleport Destination field in the Inspector settings.
Log in to your Jibe world, walk your avatar up to the teleporter cube, and click on it. You’ll immediately appear in a shower of particles at the location of your Teleport arrival point object.
You can try this out in my own Jibe world. I’ve set up a sign in my arrival area that lets folks take a trip to my windmill far across the landscape.
If you want to learn more about Jibe, be sure to join our Jibe-Unity3d Google Group for lots of great discussions and idea sharing.
-John “Pathfinder” Lester