Base Concepts
In order to have stable and good results for all weapons within your project, it's important to understand some base concepts regarding the Procedural First Person plugin. If you have this base properly configured, you should avoid most of wrong orientation problems that can appear during your work with the plugin.
This is not a linear guide, feel free to navigate along this page from bottom up.
Virtual Bone Setup
In order to fully make use of the Plugin, it's important to use a minimal Virtual Bone setup in your Character Skeletal Mesh. You might have some existing ones being used for any reason, but this shouldn't affect the necessary Virtual Bones for the Plugin functionality.
The Plugin comes with a Scripted Action that will prepare your Skeleton Virtual Bones. Simply right click your Skeleton and click on "Setup Skeleton":

Make sure to use this with your Skeleton and not your Skeletal Mesh.
A popup should appear, feel free to leave all options enabled, but as mentioned earlier, only a base setup is necessary, so you only the "Setup Single Wield" is necessary:

A Dual Wield support should be added to the Demo Project in near future.
At this point, you should have a similar structure of Virtual Bones in your "head" bone like this:

This is enough for start working with the Plugin.
The VB pivot should be your main source of motion (e.g. Sway, Recoil, Offset, etc.).
Hand Virtual Bones
If you enabled "Setup Hands" in the Skeleton Scripted Action, you should have a similar structure in your hand bones:

This optional but highly recommended, since it should make our Animation Blueprint simpler to setup.
The idea is that VB hand_r_to_ik_hand_gun follows the animated ik_hang_gun bone but inside the spine_XX hierarchy, which avoids additional "Layered Blend per Bone" Anim Nodes.
We then use this as source of positioning for our VB pivot bone, by using our "Procedural Bone Rebase" Anim Node:

In 99% cases you should only need either VB hand_r_to_ik_hand_gun or VB hand_l_to_ik_hand_gun, for all equipments. We kept all of them in the Virtual Bone setup since they might be useful for some advanced Third Person functions.
Mesh Orientation
Before adjusting any orientation related configuration values, you must ensure your mesh orientation is correct. The procedural motion system relies on attaching equipment to a pivot bone with a zero relative transform. While many animations use a specific guide bone (e.g., ik_hand_gun) to orient the equipment, a pivot bone with the equipment attached to it is mandatory in all cases.
Because of this attachment logic, the equipment mesh must face the same direction as the pivot bone. In Unreal Engine, the forward axis is +X, so your equipment mesh must also face +X. You can correct this orientation using 3D modeling software (like Blender) or by adjusting it within an Animation Blueprint. I strongly recommend using the Animation Blueprint method; it is not only often required for other logic but also creates a much more flexible structure.
Here is my preferred method for fixing equipment mesh orientation:

Make sure to select the Animation Blueprint inside the equipment Skeletal Mesh Component.
More about Orientation in next sections.
Non ik_hand_gun oriented animations
ik_hand_gun oriented animationsIf your animations (unfortunately) doesn't make use of animated ik_hand_gun bone, you can still use our Plugin. This is the same situation for when you try to integrate with the native "First Person Shooter" template from UE 5.6 onwards.
Instead of using ik_hand_gun for positioning, they instead animate a bone called weapon_r, child of hand_r. So in order to fully use this custom positioning, you can simply Copy this bone position/rotation to our pivot source like so:

Make sure to perform this Copy before any of our custom Procedural Anim Nodes.
If you have no animated bone at all (no ik_hand_gun and not weapon_r, for example), you can still use our Plugin. Simply do the same Copy mentioned, but just use your Pivot Hand (usually hand_r) as the copy source, and add a Custom Relative Transform by using the Transform (Modify) Bone anim node, like so:

It's very important to NEVER add a Relative Transform offset to your Equipment Attach. Instead, you must do as shown above, add a bone offset (location and rotation) to your pivot source bone (preferably in Bone Space).
Unfortunately you cannot make use of Sockets for positioning your equipment. Therefore, it's perfectly possible (and useful) to use Sockets for finding the best Custom Relative Transform to be used in your Transform (Modify) Bone. Simply attach a your Equipment Mesh as Preview Mesh to your Socket, adjust it, and use the final values of Relative Location/Rotation as the inputs for the Custom Relative Transform:

Ideal Animation Blueprint Setup
You can freely implement your Animation Blueprint setup as you wish, therefore there are some rules you should follow for optimal result.
Ideally, your should perform all Procedural First Person processing (Procedural Anim Nodes in general) at the END of your Anim Graph flow, like so:

The base rule for using the Procedural Anim Nodes from our Plugin is:
"Procedural Bone Rebase" indicates the begin, "Procedural Hand IK" indicates the end.
In general, you should manipulate your pivot/hand/lowerarm virtual bones within this Anim Node imaginary interval (ideally behind "Procedural Anim Offset" as well).
You can find more details about each of these Anim Nodes in this section.
Within this range, you can freely manipulate all Virtual Bones related to the Procedural First Person plugin:
VB pivotVB pivot_hand_lVB pivot_hand_rVB pivot_lowerarm_lVB pivot_lowerarm_r
Procedural Motion
The idea of the Procedural Motion Component/AnimNode, is to allow flexible and highly customization manipulation to the pivot bone, allowing to create motion such as: Sway, Recoil, Offset, Blocking, etc.
This is done by joining the "Procedural Motion" Anim Node (that manipulates our pivot bone) and all ProceduralMotion Components present either in your Character or Equipment actor.
The Anim Node expects a very simple Input structure (ProceduralMotionInput) that you can do by creating a Const/ThreadSafe function like so:

You can read more about this Input in here.
Make sure to name the Function Output as "ReturnValue" and make it BlueprintThreadSafe.
After implementing this function, you can simple call it as binding at the ProceduralMotion Anim Node:

The core idea, is that the Anim Node will look for ProceduralMotion Components present in all SourceActors and Character actors, then process their Additive Transform, ordered by their "Stage" value priority.
This way you can both use all our existing components (Sway, Recoil, Offset, Blocking, Aim, Additive) and even create your own ones! This can be done either via Blueprints or C++.
We have some samples made in both Blueprints and C++, make sure to check them out.
Last updated