GSC reference › Built-in
BeamTrace()
Built-in (engine)
Server
Performs a bullet trace between two points and returns an array of information about the trace result.
Signature
BeamTrace(<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 = BeamTrace( org1, org2 )
Real uses in BO3's scripts
Called 5 times in the decompiled scripts. A few, zombies first:
- scripts/zm/zm_genesis_skull_turret.csc, line 258
a_trace = beamtrace(v_position, v_position + (v_forward * 20000), 1, self); - scripts/zm/zm_genesis_skull_turret.csc, line 286
a_trace = beamtrace(v_position, v_position + (v_forward * 20000), 1, self); - scripts/zm/zm_genesis_skull_turret.gsc, line 430
a_trace = beamtrace(v_position, v_position + (v_forward * 20000), 1, self); - scripts/zm/zm_genesis_skull_turret.gsc, line 507
a_trace = beamtrace(v_position, v_position + (v_forward * 20000), 1, self); - scripts/zm/zm_genesis_skull_turret.gsc, line 893
a_trace = beamtrace(v_position, v_position + (v_forward * 20000), 1, e_turret);
Related built-ins
- BulletTrace()Performs a bullet trace between two points and returns an array of information about the trace result.
- 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.
- 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).