FPS Leaning not moving Weapon

Hello,

In my FPS game I set up a blueprint in my charcter where if the player presses a key then they will tilt left or right depending on the key pressed and in the animation graph it transforms the spine of the character. My issue is that doing this the weapon stays in position before the lean and everything but the weapon moves. Im confident that the issue is my weapon is attached to a bone in my character called IK_Hand_Gun_bone which when animating is what controls the two hands keeping them attached to the gun. How would I fix the leaning so the gun also moves to where the hands move when tilting

Hey @Ryd3r09!

You probably need to attach the gun to a non-ik bone… or harder-but-better, follow the bone chain up and animate the bones higher up that directly affect the ik. That being said… is it attached to the bone or a socket?

@Mind-Brain All of my weapons are being attached via data assets for each gun with the connector being the bone directly(ik_hand_gun).

I tried to make a socket connected to hand_r and it attached the weapon fine but i think since the ik_hand_gun bone is what moves hand_r and hand_l they will never move

Hmm. Interesting. Can you show the skeletal mesh’s skeleton hierarchy? What is the IK_hand_gun bone attached to? What’s the parent of that bone etc going up to spine, and what bones are being adjusted at the top level when you lean? The problem here seems to be that when you lean, the bone you’re adjusting isn’t upstream from the IK_hand_gun bone.

So based off the heirarchy the IK_hand_gun bone appears to be connected to ik_hand_root which is connected to the root. It would be to many screenshots to include to show all the bones affected from rotating spine_02 but I used the skeleton provided from the infima games so here is link to the video where i downloaded the rig. Tutorial Infima Games FPS

Now I do think I have a solution that might work that I havent tried which is similar to my ads fix as if i ads with a sight its not perfectly in center as animation was for iron sight so i apply transforms to ads animation moving ik_hand_gun up so rail in center then moving it down based on the sight. I was thinking of replicating this to the lean so each gun has a transform amount that I apply after the lean to move gun aswell(only problem being i need two, 1 for ads and 1 for not ads)

Yeah, that looks like it’s going to be the way you’re going to have to go about it. Because the thing is, unless you’re moving the root bone, you have to make the animation specifically move ik_hand_root, ik_hand_gun, and ik_hand_l/r. They’re not parented to the visible arms so… yeah you’d have to peek the whole model from the root bone otherwise.