API ReferenceGE ExtensionsgameplaydriftstuntZones
Drift Through Zone
Reference for the drift-through stunt zone class, loaded via `require("gameplay/drift/stuntZones/driftThrough")`.
Reference for the drift-through stunt zone class, loaded via require("gameplay/drift/stuntZones/driftThrough").
Overview
An oriented rectangular zone that scores when the player drifts through it (enters, exits, and the exit triggers the score). Returns a class factory function.
Factory
return function(data) → driftThroughInstanceClass Methods
| Method | Signature | Description |
|---|---|---|
init | (data) | Stores zone data, calls reset |
reset | () | Resets activeData: cooldown=0, usedFlag=false |
accomplish | () | Resets usedFlag, sets cooldown, fires onAnyStuntZoneAccomplished → onDriftThroughAccomplished with currDegAngle |
detectStunt | () | If usedFlag is true (player was outside), accomplishes |
isAvailable | () | Returns currCooldown <= 0 |
isPlayerInside | () | OBB containment check; sets usedFlag=true when player leaves |
onUpdate | () | Calls sendDecals |
sendDecals | () | Draws two parallel lines with cooldown coloring using lerp |
Key Behaviors
- Uses
containsOBB_pointfor oriented bounding box detection - The zone must be exited to set
usedFlag, then re-entered to score - Decal rendering shows two gate lines with green/red/white cooldown states
currDegAnglefalls back to 30 if drift data unavailable (for debug testing)
See Also
- drift/stuntZones/donut - Donut Stunt Zone - Related reference
- drift/stuntZones/hitPole - Hit Pole Stunt Zone - Related reference
- drift/stuntZones/nearPole - Near Pole Stunt Zone - Related reference
- Gameplay Systems Guide - Guide