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
| Name | Required? | Details |
|---|---|---|
| gunnerIndex | Optional | 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:
- scripts/shared/turret_shared.gsc, line 2518
e_target = self gettargetentity();
Related built-ins
- ClearTargetEntity()Clears the current target for this vehicle or turret.
- ClearEntityTarget()Clears an AI's entity target.
- SetEntityTarget()Set an entity as the AI's target.
- SetTargetEntity()Sets the target of this turret
- SetTargetedEntityEndTime()Set targeted entity end time, for use on the client side in the UI.
- GetTargetLockEntityArray()Get locked target
- GetTargetLockEntity()Get locked target
- GetEntityNumber()Get the entity number of the entity
- PlayRumbleOnEntity()Plays a rumble on the given entity.
- SetTurretTargetEnt()Set the target entity for this vehicle turret.
- SetTurretTargetRelativeAngles()Set the target entity for this vehicle turret.
- Target_Set()Adds a new target to draw on the hud
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).