codeAPI Reference

s&box TriggerTeleport: Trigger-based teleportation

calendar_today May 12, 2026 schedule ~2 min read person PatrickJr verified 50

TriggerTeleport Component API Reference

TriggerTeleport is a Component that teleports objects that enter its trigger collider to a target GameObject.

Type Signature

CSHARP
public sealed class TriggerTeleport : Component, Component.ITriggerListener
{
    [Property, Group("Target")]
    public TagSet Include { get; set; } = new();

    [Property, Group("Target")]
    public TagSet Exclude { get; set; } = new();

    [Property] public GameObject Target { get; set; }
    [Property] public Action<GameObject> OnTeleported { get; set; }

    void ITriggerListener.OnTriggerEnter(Collider other);
    bool IsValidTarget(ref GameObject go);
}

Properties

Target Filtering

Teleport Settings

Event Handlers

OnTriggerEnter(Collider other)

Teleports the object to the target position if it passes the tag filtering checks.

Methods

IsValidTarget(ref GameObject go)

Checks if the GameObject is a valid teleport target:
  • Converts to Root GameObject
  • Rejects proxy objects
  • Rejects objects with Exclude tags
  • Rejects objects without Include tags (if Include is not empty)

Usage

CSHARP
// Create a teleporter
var teleport = go.AddComponent<TriggerTeleport>();
teleport.Target = destinationGameObject;

// Only teleport players
teleport.Include = new TagSet { "player" };

// Don't teleport vehicles
teleport.Exclude = new TagSet { "vehicle" };

// Add a callback
teleport.OnTeleported = (obj) => Log.Info($"Teleported {obj.Name}");

Notes

  • Implements ITriggerListener to detect objects entering the trigger
  • Uses TagSet for flexible filtering
  • Teleported objects have their interpolation cleared to prevent snapping
  • OnTeleported callback is broadcast via RPC to all clients
  • Target GameObject must be valid for teleportation to work
Was this helpful?