Weapon System
In this section we will cover the weapon system.
Last updated
In this section we will cover the weapon system.
Last updated
Weapons are responsible for these gameplay actions:
Reloading
Changing fire modes
Equip/UnEquip animations
Firing
The functions above are implemented in the FPSWeapon component:
Character Controller: override controller for this weapon.
Recoil Anim Data: procedural recoil settings.
Camera Shake: recoil camera shakes.
Ik Offset: translation offset for the arms.
Left Clavicle Offset: translation offset for the left arm.
Right Clavicle Offset: translation offset for the right arm.
Aim Point Offset: translation offset for the aiming socket.
Right Hand Sprint Offset: rotation offset activated when tactical sprinting.
Ads Blend: blend between absolute and additive aiming.
Fire Rate: in rounds-per-minute.
Ammo: default ammo size.
Aim Fov: field-of-view when aiming.
Full Auto: whether the weapon supports full auto.
Use Fire Clip: whether to use firing animation.
Has Equip Override: whether to use custom equip animation.
Has Fire Out: whether to lock the bolt after firing.
Use Sprint Trigger Discipline: whether to use gun safety when sprinting.
Fire Sounds: firing sounds played randomly.
Fire Pitch Range: range for the pitch.
Fire Volume Range: range for the volume.
Weapon Event Sounds: reloading sounds played via animation events.
The weapon model has these components:
Animator is used to animate gun parts (bolt, mag, etc.), which are automatically synced with the character's movements.
FPS Bone Visibility is responsible for hiding or unhiding bones, based on animation events.
FPS Weapon Sound plays sounds related to the weapon (e.g. reloading, firing).