This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Description
Problem:
Recoil force from guns is transferred only to AHuman body (center of mass) by applying it to Arm parent.
This means there are no forces working on the actual gun when it's being fired.
ACrab class actors have no recoil force transfer at all.
Also the way this is done is messy, because the recoil force math is done in HDFirearm class, then force application is done through Arm class.
Solution:
Rework recoil handling.
- Move all recoil handling to HDFiream class.
- Apply force directly to gun only if the recoil force will cause gun to detach. Transfer remaining recoil forces to parent (arm) when guns detach.
- Create knockback effect when guns detach from high recoil by triggering "unstable" status.
This is to counter the actor violently rotating back (from high force applied not to center of mass) while the feet stay on the ground.
- For lower recoil force, apply directly to rootparent (actor), otherwise actor leans back (from constant force applied not to center of mass) and it does not look good.
- For ACrab class actors, do not apply force directly to gun because it can detach it.
Crabs have hard mounted weapons and them detaching doesn't make sense and spoils gameplay. Instead, apply forces directly to parent (turret) and let joint force transfer do the detaching of the whole turret when recoil force is too high.