GSC reference › Built-in
CanPath()
Built-in (engine)
Server
Check if a path can be found between these positions.
Signature
CanPath(<start>, <end>)
Parameters
| Name | Required? |
|---|---|
| start | Required |
| end | Required |
Example (from Treyarch's docs)
if ( self CanPath( self.origin, targetpos ) )
Real uses in BO3's scripts
Called 3 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm_ai_sentinel_drone.gsc, line 805
if(!self canpath(self.origin, self.enemy.origin)) - scripts/zm/_zm_devgui.gsc, line 353
ispath = self canpath(spawn_point.origin, node.origin); - scripts/zm/_zm_devgui.gsc, line 396
ispath = self canpath(new_spawn_point_origin, new_wait_point);
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
- FindPath()Check if a path can be found between these positions.
- 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.
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).