GSC reference › Built-in
CheckNavMeshDirection()
Built-in (engine)
Server
Run a trace on NavMesh to get the furthest position a character can move in that direction
Signature
CheckNavMeshDirection(<start>, <dir>, <dist>, [characterRadius], [materialFlags])
Parameters
| Name | Required? | Details |
|---|---|---|
| start | Required | start of the trace |
| dir | Required | direction to trace |
| dist | Required | distance to trace |
| characterRadius | Optional | the radius of the capsule used in trace. default to 0. |
| materialFlags | Optional | the flags marking whether a face type can be used |
Example (from Treyarch's docs)
pos = CheckNavMeshDirection( (10,20,30), ( 1, 1, 0 ), 25 )
Real uses in BO3's scripts
Called 4 times in the decompiled scripts. A few, zombies first:
- scripts/shared/bots/bot_traversals.gsc, line 150
ledgetop = checknavmeshdirection(endnode.origin, self.origin - endnode.origin, 128, 1); - scripts/shared/bots/bot_traversals.gsc, line 160
ledgebottom = checknavmeshdirection(self.origin, ledgetop - self.origin, dist + 15, 1); - scripts/shared/bots/bot_traversals.gsc, line 223
ledgetop = checknavmeshdirection(startnode.origin, endnode.origin - startnode.origin, 128, 1); - scripts/shared/bots/bot_traversals.gsc, line 225
ledgebottom = checknavmeshdirection(endnode.origin, startnode.origin - endnode.origin, bottomdist, 1);
Related built-ins
- GetClosestPointOnNavMesh()Get a point on NavMesh that's closest to the given position within radius.
- IsPointOnNavMesh()Checks if a given point is valid on the NavMesh.
- TracePassedOnNavMesh()Run a trace on NavMesh to see if a character can go straight from start to end.
- GetNavMeshFaceNormal()Returns the face normal vector of the closest navmesh point to the passed in position, within the search radius.
- MarkNoVehicleNavMeshFaces()Update the novehicle flag on navmesh faces.
- EnableNavMeshTrigger()Enables/disables a given navmesh trigger
- GetNavMeshTriggersForPoint()Returns a list of the names of navmesh triggers that a given point resides in
- PositionQuery_Source_Navigation()Generate points around <origin>, between <minSearchRadius> and <maxSearchRadius> and within <halfHeight> height difference.
- GetClosestPointOnNavVolume()Get a point on nav volume that's closest to the given position within radius.
- IsPointInNavVolume()Checks if a given point is within the specified navigation volume.
- DirectionalHitIndicator()Create a directional hit indicator
- IsNavVolumeLoaded()Checks whether nav volume is loaded
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).