TeleportToSpace

Method

Teleport user to a space.

Definition

void TeleportToSpace(string spaceID, bool showPopup = true)
void TeleportToSpace(string spaceID, bool showPopup = true)

Parameters

ParameterDescription
string spaceID

Space ID where to travel to

bool showPopup

Examples

public class TeleportToSpace : MonoBehaviour
{
public SpatialTriggerEvent trigger;
public string spaceId;

void Start()
{
trigger.onEnterEvent += HandleTriggerEnter;
}

void OnDestroy()
{
trigger.onEnterEvent -= HandleTriggerEnter;
}

void HandleTriggerEnter()
{
SpatialBridge.spaceService.TeleportToSpace(spaceId, false);
}
}
public class TeleportToSpace : MonoBehaviour
{
public SpatialTriggerEvent trigger;
public string spaceId;

void Start()
{
trigger.onEnterEvent += HandleTriggerEnter;
}

void OnDestroy()
{
trigger.onEnterEvent -= HandleTriggerEnter;
}

void HandleTriggerEnter()
{
SpatialBridge.spaceService.TeleportToSpace(spaceId, false);
}
}