Search Unity

Weapon recoil as spring?

Discussion in 'Scripting' started by vincentellis, Aug 2, 2018.

  1. vincentellis

    vincentellis

    Joined:
    Oct 21, 2013
    Posts:
    100
    I was reading CryEngine's codebase, and specifically, the procedural motion bits in the weapon module: https://github.com/CRYTEK/CRYENGINE...628643917c820/Code/GameSDK/GameDll/Recoil.cpp

    Their recoil implementation is very interesting. It seems to be some sort of spring, applying the effect on the world position of the weapon model (and arms). No IK, no bones, Seems to be the whole object. Does anyone have any material on this subject? Or is this very unique? How everyone else is doing this?

    I'm very curious about this kind of thing. They also seem to add a jump bump motion procedurally, as well as sway and movement, but I still haven't found those pieces of code. I'm suspecting a classic Lissajous curve.
     
  2. vincentellis

    vincentellis

    Joined:
    Oct 21, 2013
    Posts:
    100