Handling Recoil

The Recoil component is responsible for applying camera or weapon shake whenever the weapon is fired. It should be attached to the Recoil GameObject under your weapon prefab, and it must be linked in the Weapon script on the root object.

πŸ”— Integration

To enable recoil in your weapon:

  1. Make sure your weapon prefab has a child GameObject named Recoil.
  2. Attach the Recoil script to that object.
  3. In the Weapon script (on the root), assign the Recoil object in the relevant field.
  4. Test your weapon and tweak values to get the desired effect. β€œProject Structure”