Skip to main content

Trigger

Trigger creates a shape-based volume in the world that detects when other actors overlap it. These triggers are useful for gameplay logic like entering zones, starting scripted events, teleporting players, or detecting proximity. Supported shapes include spheres, boxes, and capsules. You can assign a Lua callback to respond to overlaps and optionally restrict which classes are allowed to trigger them

/// tip Trigger is an Actor so it inherits all functions from Actor ///

Constructorโ€‹

Example
local trig = Trigger(
Vector(0, 0, 200),
Rotator(),
Vector(100),
TriggerType.Sphere,
true,
function(self, other) print(other:GetName()) end,
Color(1, 0, 0, 0.5)
)
NameTypeDefaultDescription
LocationVector(0,0,0)World position for the trigger
RotationRotator(0,0,0)World rotation
ExtentVector(100,100,100)Shape extents (radius, box half-size, or capsule radius/height)
TriggerTypeenumTriggerType.SphereShape of the volume รขโ‚ฌโ€ Sphere, Box, or Capsule
bVisiblebooleanfalseIf true, draws a semi-transparent debug shape
CallbackFunctionfunctionRequiredFunction called on actor overlap
ColorColor(0,1,0,0.5)Debug color if visible
OverlapOnlyClassestable{}Optional array of UClass paths to restrict overlap (e.g. only /Script/Engine.Pawn)
โœจ