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:
- Make sure your weapon prefab has a child GameObject named
Recoil
. - Attach the
Recoil
script to that object. - In the
Weapon
script (on the root), assign theRecoil
object in the relevant field. - Test your weapon and tweak values to get the desired effect.