ImpactEffect
(tr)
Spawn a bullet impact at a trace hit - the hit surface's impact sound and decal/particle, oriented
to the surface and parented to what was hit (its nearest bone for skinned models, so decals stick
to moving things). A hit object that's already gone - killed by this very shot - still gets its
impact, left where it landed in the world. A pure presentation utility like
Sandbox.BaseWeapon.ShootBullet(Sandbox.Scene,Ray,System.Single,System.Single,System.Single,System.Single,Sandbox.GameObject,Sandbox.GameObject,Sandbox.GameObject,Sandbox.TagSet);
call it wherever you resolve a hit. Does nothing on a dedicated server or for a trace that missed.
ImpactPrefab
(hitObject, surface, position, normal)
Spawn just the surface impact prefab (decal/particles) at a hit, stuck to what was hit - no sound.
For attacks that want the visual but their own impact audio (a melee thunk instead of a ricochet).
ShootBullet
(scene, ray, distance, radius, damage, force, attacker, weapon, ignore, tags)
SceneTraceResult
Traces a bullet through the world and, on the host, damages and pushes whatever it hits. This
is a pure utility - it holds no state, so you can call it from anywhere (a weapon, a trap, an
NPC, an explosion). Returns the trace result so the caller can spawn tracers, decals and play
sounds.
ShootBullets
(scene, ray, count, spread, distance, radius, damage, force, attacker, weapon, ignore, tags)
SceneTraceResult[]
Fires a volley of bullets - one trace per pellet, each randomly deflected within
, resolved through Sandbox.BaseWeapon.ShootBullet(Sandbox.SceneTraceResult,System.Single,System.Single,Sandbox.GameObject,Sandbox.GameObject,Sandbox.TagSet,System.Boolean)
(GMod's
FireBullets). A pure utility like ShootBullet - damage and impulse apply on the
host only. Returns every pellet's trace so the caller can drive tracers and impacts.