API ReferenceGE ExtensionsgameplaydriftstuntZones
Hit Pole Zone
Reference for the hit-pole stunt zone class, loaded via `require("gameplay/drift/stuntZones/hitPole")`.
Reference for the hit-pole stunt zone class, loaded via require("gameplay/drift/stuntZones/hitPole").
Overview
Spawns a delineator pole that the player must physically collide with while drifting. One-time use per reset (no cooldown, just becomes unavailable). Returns a class factory function.
Factory
return function(data) → hitPoleInstanceClass Methods
| Method | Signature | Description |
|---|---|---|
init | (data) | Stores data, resets, spawns delineator vehicle (pole.pc config), creates overhead marker |
reset | () | Resets physics on pole vehicle, clears/recreates marker |
resetData | () | Resets activeData: hitPole=false, available=true |
clear | () | Deletes pole vehicle and clears marker |
clearMarker | () | Removes overhead race marker |
createMarker | () | Creates overhead marker at pole position |
accomplish | () | Clears marker, sets unavailable, fires onAnyStuntZoneAccomplished → onHitPoleAccomplished with angle and speed |
detectStunt | () | Scores on first frame of collision detection |
isAvailable | () | Returns self.activeData.available |
onUpdate | (dtReal, dtSim) | Updates marker, detects vehicle collision via map.objects[vehId].objectCollisions |
onVehicleDestroyed | (vehId) | If the pole vehicle is destroyed, removes this stunt zone |
Key Behaviors
- Spawns an actual
delineatorBeamNG vehicle as the pole - Collision detection uses the physics engine's
objectCollisionsmap - Marker uses
scenario/race_markeroverhead style - One-shot: once hit, the zone becomes unavailable until
reset() - Hook data includes
currDegAngleandcurrAirSpeedfor scoring
See Also
- drift/stuntZones/donut - Donut Stunt Zone - Related reference
- drift/stuntZones/driftThrough - Drift-Through Stunt Zone - Related reference
- drift/stuntZones/nearPole - Near Pole Stunt Zone - Related reference
- Gameplay Systems Guide - Guide