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

Recoil Forces of HDFirearm are transferred badly and only to AHuman body #7

@MaximDude

Description

@MaximDude

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.

  1. Move all recoil handling to HDFiream class.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions