TwoBoneIK not working. How to Snap hands? Question

I was following Epic’s documentation , to setup Virtual Bones on my UE5 Skeleton. Reason - I wanna snap both the hands of my skeleton to the Gun currently being held.
I followed the documentation but I’m getting a weird glitch. While moving in game, the whole skeleton stays rigid only the neck moves, and it rejects the aim offset etc.
This is an example

Here is the virtual bones setup (following documentation again)

Here are the TwoBoneIK nodes, following Epic’s documentation

I also tried a separate value using a tutorial but that didn’t work either. Although, this tutorial worked perfectly on the UE4 skeleton in the same project.

TL;DR - I’m trying to setup snapping for my skeleton hands but TwoBoneIK is not working on UE5 Skeleton. Is there any way to fix this here or any alternative (I’ve heard FABRIK but it’s documentation is confusing)

So in my experience, trying to temper animation movement procedurally is very variable. Two bone iks will tend to affect the effector and root alone, stretching and morphing the skeleton horribly if it goes slightly out of range. Is there any reason you’re not attaching the gun to a socket? This way, you could place a child scene component where you want the hand to be ok the gun, and (assuming the animations themselves don’t achieve the results you want), use the control rig to snap the other hand to the scene component.

1 Like

I’m sorry I’m new to Animations.
The problem is, if I don’t use TwoBoneIK then the left hand is not snapping to the weapon and I was not able to find any alternative to snap it. The animations were originally meant for UE4 Skeleton and hence they’re retargeted and I tried to replicate the UE4 skeleton onto UE5 by adding the virtual bones.

Edit - I am attaching the gun to the socket actually. The socket is on the right hand but the problem is the left hand. It wobbles around if not snapped to the desired location, which in my case is right under the barrel. I read (epic’s documentation) that Virtual bones are good for such things like snapping hands etc but their values don’t work for me somehow. The asset pack I used already had VB setup on UE4 Skeleton and that skeleton is perfect but I cannot translate all that to UE5 Skeleton because Unreal won’t let me add Virtual bones on skeletons for some reason. I even tried using Character Creator 4 characters but I cannot add VB on their skeleton either, resulting in either awful looking left hand or broken IK system bcz of TwoBoneIK working on improper Virtual bones.

Can you explain a bit more, how can I get around this? How can I actually snap the left hand ?

The only way I know to do this is through the control rig, which is a fairly intermediate system so I’ll preface this by saying that if you’re not willing to dig into how it all works at the moment, I’d suggest you scale down the gun so it fits the animation (easy mode).

Another option might be to edit the animations themselves (which also requires using the control rig). Here’s a good video on how to get it set up: link 1 link 2
Once you’re in sequencer, get to the first frame, click on your left hand control, open up the curve editor and drag THE WHOLE CURVE (location x, y, z) around until you find the right spot. This way you’ll retain the smooth movement of the animation (as opposed to going frame by frame, which is a pain in the a$$ and the results are sketchy). (intermediate mode)

Alternatively, dig into procedural animation. Once you’ve set up your rig (same as above but with only left hand and clavicle_l controls), then you’d set up a scene component in your character BP and feed the location of it into the control rig in your character anim BP, and set the location of the left hand control, with 3 bone (or full body) IK node in the control rig. Control rigs are very powerful, albeit underdeveloped, and worth understanding but also very very involved. I’ve just tried to highlight the steps for now in case you take another path but happy to go into more detail once you’ve made a start. (advanced mode)

1 Like

Thanks for the explanation. Control rig sounds a bit complicated, I’ll look into it. Since, the animations were from an asset pack and that asset pack was on UE4 Skeleton and that skeleton was already made by the author and it already had Virtual bones in it. I retargeted those on to UE5 skeleton, but since the “bug” in Unreal Engine prevents me from creating VB on UE5 Skeleton hence the problem.

l’ll give it a try. Thanks

1 Like

Try Rm Fix Tool, it has snap IK option, also let’s you fix, add, root motion and change animation direction RM Fix Tool in Code Plugins - UE Marketplace (unrealengine.com)