Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to or the best practice to handle gun fire cycles?

Discussion in 'Animation' started by NuclearApples, Mar 31, 2023.

  1. NuclearApples

    NuclearApples

    Joined:
    Apr 3, 2020
    Posts:
    5
    Hi all,

    i am just wondering What is the best way or best practice or standard/common way to handle gun fire cycles…

    I’ve been doing quite a bit of research online and surprisingly I cannot find much about how video games handle a gun fire rates accurate to animation.

    For example:
    I’m using weapon sway when idle and moving using trigonometry Kind of like procedurally but mostly forced and for the cameras horizontal and vertical recoil is handled again procedurally by Random values on the X and Y.

    The model itself is parented to A camera that is attached as an overlay camera to the main camera, the Main camera is attached to the character control and then there is an IK Rig For the arms that uses animation rigging to parent targets on a chain to the gun.

    All of that works fine visually the gun Movement, recoil, idle sway is fine.

    The problem I’m having Is figuring out how to accurately represent the fire cycle or the fire rate of any said gun. So the animation of The gun being fired on the slide or hammer either re-chambering Cycling
    I can never get to look right.

    there don’t seem to be enough frames to actually depict a cycle true to its RPM.

    another example, I have a Kris vector and it’s fire rate is 1200 rpm so I think my maths is correct that’s one minute So 60 frames a second and 60 seconds to a minute so that would be 60×60 Which of the top of my head is around 3600 frames, so if my thinking is correct 1200 rounds over 3600 frames Would be 3 frames per shot/Cycle.

    I’m not animating an entire 1200 rounds on a minute of animation only doing the one shot in a cycle so the problem is only having three frames for one shot doesn’t have much in the way of detail and makes the weapon look very strange when firing.
    Whereas something like an M4 shooting around say 460 rounds has more frames about eight frames and looks better because they’re slightly more detail.
    Put the higher firing guns with less frames just look awful.

    How do I solve the issue because obviously real guns don’t adapt to frame limitations but how do I get the gun to look somewhat accurate it doesn’t have to be completely accurate it just has to look better and match what the projectile and hit information is relaying.

    i know this is very long and I appreciate if you made it through any help or information, even ideas would be grate