# Sandbox.BaseWeaponModel

Marks up a weapon's view or world model with the attachment points the weapon fires from - the
muzzle, the shell-eject port, and so on - and plays the stock presentation off them: muzzle
flash, brass and tracer prefabs, plus the b_deploy/b_attack/b_reload animation parameters. Drop
this on a weapon model prefab, wire the attachment GameObjects, and override the On* hooks to
extend or replace any of it. The holding [Sandbox.BaseCombatWeapon](/api/Sandbox.BaseCombatWeapon) drives it through those hooks.

- Kind: class
- Namespace: `Sandbox`
- Assembly: `Sandbox.Engine`
- Inherits: [Sandbox.Component](/api/Sandbox.Component)

## Constructors

- [`BaseWeaponModel`](/api/Sandbox.BaseWeaponModel/.ctor)

## Properties

- [`DeploySound`](/api/Sandbox.BaseWeaponModel/DeploySound): Sound played when this weapon model is deployed (drawn).
- [`EjectBrass`](/api/Sandbox.BaseWeaponModel/EjectBrass): Effect prefab spawned at the shell-eject port when the weapon fires (the flying brass). Defaults to a generic casing - clear it for none.
- [`MuzzleEffect`](/api/Sandbox.BaseWeaponModel/MuzzleEffect): Effect prefab spawned at the muzzle when the weapon fires (muzzle flash, smoke). Defaults to a generic flash - clear it for none.
- [`MuzzleGameObject`](/api/Sandbox.BaseWeaponModel/MuzzleGameObject): The muzzle attachment - where shots and muzzle effects originate.
- [`Renderer`](/api/Sandbox.BaseWeaponModel/Renderer): The skinned model renderer for this weapon model.
- [`ShellEjectGameObject`](/api/Sandbox.BaseWeaponModel/ShellEjectGameObject): The shell-eject attachment - where spent casings are thrown from.
- [`TracerEffect`](/api/Sandbox.BaseWeaponModel/TracerEffect): Effect prefab spawned from the muzzle toward the hit point (the bullet tracer). Defaults to a generic tracer - clear it for none.

## Methods

- [`DoEjectBrass`](/api/Sandbox.BaseWeaponModel/DoEjectBrass): Spawns [Sandbox.BaseWeaponModel.EjectBrass](/api/Sandbox.BaseWeaponModel/EjectBrass) at the shell-eject attachment and throws it out, if both are set.
- [`DoMuzzleEffect`](/api/Sandbox.BaseWeaponModel/DoMuzzleEffect): Spawns [Sandbox.BaseWeaponModel.MuzzleEffect](/api/Sandbox.BaseWeaponModel/MuzzleEffect) parented to the muzzle attachment, if both are set.
- [`DoTracerEffect`](/api/Sandbox.BaseWeaponModel/DoTracerEffect)
- [`GetMuzzleTransform`](/api/Sandbox.BaseWeaponModel/GetMuzzleTransform): The muzzle world transform, or the model's own transform when there's no muzzle attachment.
- [`GetShellEjectTransform`](/api/Sandbox.BaseWeaponModel/GetShellEjectTransform): The shell-eject world transform, or the model's own transform when there's no eject attachment.
- [`GetTracerOrigin`](/api/Sandbox.BaseWeaponModel/GetTracerOrigin): The point a tracer starts from - the muzzle.
- [`OnAttack`](/api/Sandbox.BaseWeaponModel/OnAttack)
- [`OnDeploy`](/api/Sandbox.BaseWeaponModel/OnDeploy): Called when this weapon model is deployed (drawn). Base sets the "b_deploy" animation parameter and plays [Sandbox.BaseWeaponModel.DeploySound](/api/Sandbox.BaseWeaponModel/DeploySound). Override to extend.
- [`OnIncrementalReload`](/api/Sandbox.BaseWeaponModel/OnIncrementalReload): Called when a round is loaded during an incremental (one-at-a-time) reload. Base does nothing - override for the per-shell animation.
- [`OnReloadCancel`](/api/Sandbox.BaseWeaponModel/OnReloadCancel): Called when a reload is cancelled part-way through. Base does nothing - override to stop timed sounds and so on.
- [`OnReloadFinish`](/api/Sandbox.BaseWeaponModel/OnReloadFinish): Called when the reload finishes. Base clears the "b_reload" animation parameter. Override to extend.
- [`OnReloadStart`](/api/Sandbox.BaseWeaponModel/OnReloadStart): Called when the weapon starts reloading. Base sets the "b_reload" animation parameter. Override to extend (incremental animations, timed reload sounds).
