# Sandbox.BaseCombatWeapon.ShootBullet

## Overload 1

```csharp
static SceneTraceResult ShootBullet(Scene scene, Ray ray, float distance, float radius, float damage, float force, GameObject attacker, GameObject weapon, GameObject ignore = null, TagSet tags = null)
```

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.

## Remarks

Damage and the physics impulse are applied on the host only, so it stays authoritative no
matter who calls it - a client still gets the trace result back for effects, but can't deal
damage. Call it from the host (or a host-routed path) when you want the hit to count.

### Parameters

- `scene` (`Scene`): Scene to trace in.
- `ray` (`Ray`): Origin and direction of the bullet (apply any aim cone before calling).
- `distance` (`float`): How far the bullet travels.
- `radius` (`float`): Bullet radius - 0 for a thin ray, higher to be forgiving.
- `damage` (`float`): Damage dealt to what we hit.
- `force` (`float`): Impulse applied to the hit physics body, along the bullet direction.
- `attacker` (`GameObject`): Who fired this - credited for the damage and ignored by the trace.
- `weapon` (`GameObject`): The weapon GameObject, recorded on the damage.
- `ignore` (`GameObject`), default `null`: Hierarchy to ignore. Defaults to `attacker`.
- `tags` (`TagSet`), default `null`: Optional damage tags (e.g. "bullet").

### Returns

`SceneTraceResult`

## Overload 2

```csharp
static SceneTraceResult ShootBullet(SceneTraceResult tr, float damage, float force, GameObject attacker, GameObject weapon, TagSet tags = null, bool hitboxTags = True)
```

Applies the damage and physics impulse for an already-run bullet trace. Use this overload when
you want to run - and inspect or customise - the trace yourself, then resolve the hit; the
[Sandbox.BaseCombatWeapon.ShootBullet](/api/Sandbox.BaseCombatWeapon/ShootBullet)
overload is just this with a standard trace run for you. Returns `tr` unchanged
so callers can chain tracers, decals and sounds.

## Remarks

Damage and the impulse are applied on the host only - a client gets the trace straight back and
deals nothing. Call it from the host (or a host-routed path) when you want the hit to count.

### Parameters

- `tr` (`SceneTraceResult`): The bullet trace result to resolve. Nothing happens if it didn't hit.
- `damage` (`float`): Damage dealt to what we hit.
- `force` (`float`): Impulse applied to the hit physics body, along the trace direction.
- `attacker` (`GameObject`): Who fired this - credited for the damage.
- `weapon` (`GameObject`): The weapon GameObject, recorded on the damage.
- `tags` (`TagSet`), default `null`: Optional damage tags (e.g. "bullet").
- `hitboxTags` (`bool`), default `True`: Merge the hit hitbox's tags (e.g. "head") into the damage tags, so receivers can apply hitgroup rules like headshot multipliers. Turn off for attacks that shouldn't count hitgroups (e.g. melee).

### Returns

`SceneTraceResult`

Declared in [Sandbox.BaseCombatWeapon](/api/Sandbox.BaseCombatWeapon).
Assembly: `Sandbox.Engine`.
