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

NameRequired?Details
start_posRequired (point) The start position for the trace.
end_posRequired (point) The end position for the trace.
hit_charactersRequired (bool) Tell the trace to hit characters or not.
ignore_entRequired (entity) Entity to ingore for trace.
ignore_waterOptional (bool) Ignore water - defaults to false.
ignore_glassOptional (bool) Ignore glass - defaults to false.
ignore_ent2Optional (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:

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