Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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