GSC reference › Built-in

PositionQuery_Filter_DistanceToGoal()

Built-in (engine) Server

Calculate the distance to <entity>.goalpos. If the point is in <entity>.goalradius, the distance will be 0. the result is in pointStruct.distToGoal

Signature

PositionQuery_Filter_DistanceToGoal(<queryStruct>, <entity>)

Parameters

NameRequired?Details
queryStructRequired result from PositionQuery_Source function."
entityRequired the entity used to check goal."

Example (from Treyarch's docs)

PositionQuery_Filter_DistanceToGoal( queryResult, self )

Real uses in BO3's scripts

Called 21 times in the decompiled scripts. A few, zombies first:

Related built-ins

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).