Here’s a demo of our system which works in first person and third person. The logic of the guns itself is driven by the Logic Driver plugin, not by an animation state machine.
I’m trying to create something that uses as few animations as possible and repositions everything with IK in order to save time animating.
I plan on having basic stances,
One Handed for things like pistols
Two Handed for things like rifles
Shouldered (For things like rocket launchers, in case Two Handed doesn’t work),
Chainsaw Grip (For things like miniguns, Smartgun from Alien, or other giant heavy weapons),
Each one has its own set of aim offsets, default equip/unequip animations, and idle poses. A weapon can use the defaults but can also override each one if needed. Each weapon also has hand pose overrides. I use a layered blend per bone on the fingers, attachment bones, and IK offset bones. This makes it possible to reuse the common two handed idle pose for every two handed weapon with different hand poses. There will be cases where it doesn’t look good and a custom one for the weapon can be used where I adjust some arm positions.
In the video you can see that even the reloading animation works decently. I use animation curves to control how IK controls the hands. The hands are also procedurally placed relative to your eyes so as you look around your gun follows. And each gun can control the offset relative to your eyes depending on if you’re looking up, forward, or down and be repositioned depending on what looks best for the gun to make it look nice in first person. When the character’s hand reaches down towards the body to put away the magazine, it’s actually using the animated position, not the procedurally placed position, and this blends smoothly. I also use an anim curve to influence how much the aim offset is actually contributing, so during reloads, it can actually have less influence to prevent the gun from being in janky positions during the main animation where we can’t guarantee that the hands will be in a safe idle pose.
I also apply other layers of positioning on the hands, like when you walk, your gun sways, or when you jump or take damage, or recoil, it moves. I can also easily position it for VR controls. And the gun animates nicely in VR because it takes less influence from the procedurally placed location at times.
I’m currently working on getting it to work with locomotion as well. I’m actually creating a locomotion system that’s simpler based on a combination of ALS V4 and V3. It’s not quite as nice, but my aim is to create something that doesn’t get in the way of first person controls and all the head and hip bone positioning we have to do. And we’re hoping to have many monsters on screen so a simpler animation system may be good. Or I might even just straight up use ALS on monsters while I use my own anim BP on the player.
MostHostLA’s comment is making me reevaluate if I want to create walk cycles for each stance since it can be a struggle to get my guy to look good while walking. It looks fine in first person, while in third person his hands look a tad robotic. I could try procedurally moving the hands more in third person and less in first person like I am now.
It’s hard with crouching, especially. The best crouching animations have the character bent over forward more than when upright. And when you start walking, your legs raise up a bit, and the body is leaned over even more.
However my character’s animations are all built for the upright position. If you simply do layered blend per bone on the hip, his body just stays upright when crouched which looks bad and makes the character have a much bigger height than he should. I plan on doing more work where I measure the offsets of the hips relative to the head after locomotion, and then do a bunch more IK to reposition things so the angle of the upper body is preserved from locomotion while still reusing the upright pose that was animated for the weapons.
I also have to push the pelvis back in first person so as you look down, your vision doesn’t clip into your body. Your eyes stay stable as you look around. The camera isn’t actually connected to the head. The head moves to the camera, which will work good for VR as well. This way the aiming and movement feel precise like a first person shooter, and not floaty like a lot of other first person examples where the camera simply attaches to the character model.