Adding teleportation area to Cesium tilesets using XR Interaction Toolkit

I suspect the issue is that the Teleportation Areas added need to have the “Teleport” mask.

You may need to change the code in order to set the correct Mask, i.e:

        tileset.OnTileGameObjectCreated += go =>
        {
            var teleportationArea = go.AddComponent<TeleportationArea>();
            teleportationArea.interactionLayers = InteractionLayerMask.NameToLayer("Teleport");
        };

There is nothing showing up in the tiles. Right now the following script is attached to an empty game object (shared earlier), referencing the tileset.
using CesiumForUnity;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;

public class AttachTeleportationArea : MonoBehaviour
{
// You can drag-and-drop the desired tileset into this variable in the Inspector.
// But for demonstration’s sake, this will assume that the script is attached to
// a game object with a Cesium3DTileset component.
public Cesium3DTileset tileset;

void Awake()
{
    tileset = gameObject.GetComponent<Cesium3DTileset>();
    if (tileset != null)
    {
        tileset.OnTileGameObjectCreated += go => go.AddComponent<TeleportationArea>(); 
    }
}

}

Hehe, I see the problem. If you remove the line

tileset = gameObject.GetComponent<Cesium3DTileset>();

It should work.

Its looking for a Cesium3DTileset thats attached to the CesiumTeleportation GameObject, but there is none.

1 Like

Ok, amazing! I removed the line and set teleport layer to default inside teleport interactor. Works great, now I can jump all over the world. Thanks! I would suggest you to create a separate article explaining how to do this, I am sure a lot of VR developers would be grateful.

1 Like

Hi,
I am new in unity for cesium and don’t have enough knowledge about teleportation but i have same task to solve where i want to teleport for cesium terrain please guide me through stepwise what should i do first.
Thanks