Entity.DispatchTraceAttack
From GMod Wiki
Function | |
Syntax | Entity:DispatchTraceAttack( CTakeDamageInfo Damage, Vector vStartPos, Vector vEndPos ) |
Description: | |
"Fires" an attack onto the entity, similar to it being hit by a bullet. But instead of using bullet info, the more generic DamageInfo is used, even if the entity doesn't collide with the line formed by vStartPos and vEndPos. | |
Returns: | nil |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.DispatchTraceAttack]Entity.DispatchTraceAttack [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | N/A | ||
---|---|---|---|
Used on | |||
Code |
| ||
Output | N/A |
Additional Notes
- This is useful to melee weapons, since a direct line to the target isn't necessary.
- As stated above, the line doesn't have to pass through the entity, simply near the entity.
- This function differs from TakeDamageInfo in that the entity not only takes the damage but also that the engine triggers any related effects such as blood.