The method employs Unreal Engine 5's additive animations.
Game Developer and Unreal Engine enthusiast known as Goober-Gaming has taken to Reddit to propose a "simple and elegant solution" for making third-person weapon handling animations look more realistic.
The method in question involves using an additive "tuck" animation in Unreal Engine 5, along with some math and capsule tracing to determine the alpha of the additive, thus allowing the player character to bring their weapon closer to themselves when near walls or enemies, resulting in a more lifelike effect. As part of the solution, the bullets travel from the barrel to the crosshair, and the gun's position is adjusted to point as closely as possible toward the center, enabling the player to maintain some accuracy even when the weapon is tucked in.
You can learn more about the setup by checking out Goober-Gaming's original Reddit post. And if you'd like to learn more about additive animations in UE5, we highly recommend this insightful tutorial from Gorka Games:
Don't forget to join our 80 Level Talent platform and our new Discord server, follow us on Instagram, Twitter, LinkedIn, Telegram, TikTok, and Threads, where we share breakdowns, the latest news, awesome artworks, and more.