GSC reference › Built-in
BulletTrace()
Built-in (engine)
Server
Performs a bullet trace between two points and returns an array of information about the trace result.
Signature
BulletTrace(<start_pos>, <end_pos>, <hit_characters>, <ignore_ent>, [ignore_water], [ignore_glass], [ignore_ent2])
Parameters
| Name | Required? | Details |
|---|---|---|
| start_pos | Required | (point) The start position for the trace. |
| end_pos | Required | (point) The end position for the trace. |
| hit_characters | Required | (bool) Tell the trace to hit characters or not. |
| ignore_ent | Required | (entity) Entity to ingore for trace. |
| ignore_water | Optional | (bool) Ignore water - defaults to false. |
| ignore_glass | Optional | (bool) Ignore glass - defaults to false. |
| ignore_ent2 | Optional | (entity) Second entity to ingore for trace. |
Returns
entity
Example (from Treyarch's docs)
a_trace = BulletTrace( org1, org2 )
Real uses in BO3's scripts
Called 184 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm.gsc, line 6683
trace = bullettrace(self.origin + vectorscale((0, 0, 1), 10), self.origin, 0, undefined); - scripts/zm/_zm_ai_margwa_elemental.gsc, line 1496
trace = bullettrace(target_pos, target_pos - vectorscale((0, 0, 1), 64), 0, self); - scripts/zm/_zm_ai_mechz.gsc, line 384
trace = bullettrace(s_spawn_location.origin, s_spawn_location.origin + (vectorscale((0, 0, -1), 256)), 0, s_location); - scripts/zm/_zm_ai_napalm.csc, line 405
trace = bullettrace(self geteye(), level.napalm_zombie.origin, 0, self); - scripts/zm/_zm_ai_quadrotor.gsc, line 288
trace = bullettrace(start, end, 0, self, 0, 0);
Related built-ins
- BulletTracePassed()Allows script to do a bullet point trace with ( MASK_SHOT & ~CONTENTS_SKY ) returns true if the trace does not hit anything
- PhysicsTrace()Does a physics trace from start to end.
- SightTracePassed()Does a sight trace from start to end.
- GroundTrace()Allows script to do a point trace with MASK_SHOT + MASK_ITEM.
- DamageConeTrace()Determines how much the entity can be seen from the given position.
- SightConeTrace()Determines how much the entity can be seen from the given position, using the same check that is used by grenades.
- PlayerPhysicsTrace()Does a physics trace and returns the hit point.
- TracePassedOnNavMesh()Run a trace on NavMesh to see if a character can go straight from start to end.
- TracePoint()Traces a poitn throught the world with MASK_SHOT.
- BeamTrace()Performs a bullet trace between two points and returns an array of information about the trace result.
- PhysicsTraceEx()Physics trace, ignoring characters.
- WorldTrace()Trace from start to end
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).