Garry's Mod Wiki

Garry's Mod Wiki

  Entity:DispatchTraceAttack( CTakeDamageInfo damageInfo, table traceRes, Vector dir = traceRes.HitNormal )

Description

Performs a trace attack towards the entity this function is called on, as if an invisible bullet is shot towards it. Visually identical to Entity:TakeDamageInfo.

Calling this function on the victim entity in ENTITY:OnTakeDamage can cause infinite loops.
This function correctly applies damage to func_breakable_surf entities, unlike Entity:TakeDamageInfo.

Arguments

1 CTakeDamageInfo damageInfo
The damage to apply.
2 table traceRes
Trace result to use to deal damage. See TraceResult structure
3 Vector dir = traceRes.HitNormal
Direction of the attack.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...