GSC reference › Built-in
FindPath()
Built-in (engine)
Server
Check if a path can be found between these positions.
Signature
FindPath(<start>, <end>)
Parameters
| Name | Required? | Details |
|---|---|---|
| start | Required | . |
| end | Required | . |
Example (from Treyarch's docs)
if ( self FindPath( self.origin, potentialpos ) )
Real uses in BO3's scripts
Called 36 times in the decompiled scripts. A few, zombies first:
- scripts/zm/archetype_genesis_keeper_companion.gsc, line 840
pathsuccess = self findpath(self.origin, point.origin, 1, 0); - scripts/zm/archetype_zod_companion.gsc, line 380
if(isdefined(enemypositiononnavmesh) && entity findpath(positiononnavmesh, enemypositiononnavmesh, 1, 0)) - scripts/zm/zm_island.gsc, line 551
if(zombie_utility::is_player_valid(level.activeplayers[i]) && self findpath(self.origin, level.activeplayers[i].origin, 1, 0)) - scripts/zm/zm_stalingrad.gsc, line 2090
if(zombie_utility::is_player_valid(level.activeplayers[i]) && self findpath(self.origin, level.activeplayers[i].origin, 1, 0)) - scripts/shared/abilities/gadgets/_gadget_clone.gsc, line 589
if(isdefined(clone._goal_center_point) && clone findpath(clone.origin, clone._goal_center_point, 1, 0))
Related built-ins
- ConnectPaths()Connects the paths that intersect with the entity.
- DisconnectPaths()Disconnects the paths that intersect with the entity.
- PathMode()Set the path mode of this actor.
- HasPath()Returns true/false if AI has a path
- ClearPath()Clears the AI's current path.
- AttachPath()Attaches this vehicle to the given path.
- StartPath()Starts the vehicle following this path.
- SetRepairPaths()True allows havok to repath automatically if the AI moves off their predefined path.
- CalcApproximatePathToPosition()Returns an array of world positions representing the approximate path an actor will take.
- PathDistance()Returns the approximate/semi-accurate path distance between two points or undefined if no path can be found.
- DrivePath()Starts the vehicle driving this path and uses the vehicle physics, not locked to the spline, can only achieve turns that the physics can handle.
- CanPath()Check if a path can be found between these positions.
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).