GSC reference › Built-in

GetTargetEntity()

Built-in (engine) Server Called on: turret_or_vehicle

Gets the target entity of this turret or vehicle weapon

Signature

<turret_or_vehicle> GetTargetEntity([gunnerIndex])

Called on an entity: turret_or_vehicle GetTargetEntity(...)

Parameters

NameRequired?Details
gunnerIndexOptional the gunner index if called on a vehicle

Returns

entity

Example (from Treyarch's docs)

target = roof_turret GetTargetEntity( ); target = tank GetTargetEntity( )

Real uses in BO3's scripts

Called 1 time 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).