Rigging leg with IKTwoBone in UE5.1 makes leg look twisted up and crimped

I’m rigging a 3D model for my first time. When I plug my model’s thigh, calf, and foot into an IKTwoBone function it makes the leg look all twisted and crimped. I’m using Unreal Engine 5.1. How do I get this to look the way it did originally while using IKTwoBone to rig the leg? Any help or suggestions at all are greatly appreciated; I’m desperate to solve this issue.

Broken version ^

The way it’s supposed to look ^

My setup ^

Generally speaking, you need a Pole to be able to do leg IK without twisting obscenely.

Also, it just looks like the leg is getting twisted 180 or more around. Could be a rotation issue OR bad weight paint. hard to tell from the image.

1 Like

Your help is very appreciated. I have a pole for the aim of the knee but no matter how I try to move or twist it it still looks bugged out. The actual motion of the leg using the IKTwoBone seems to work as intended (moving the foot also bends the knee, moving the knee control aims the knee at the control properly) but it still looks squished up. I’m following this tutorial: (8) How to Animate Characters in UE5 - YouTube and the part I’m stuck on is at 25:24 in the video.

Here are some different angles of the bugged out leg:


If you want any specific angles or details at all just let me know. I really appreciate your help. I’m so desperate for a solution.

This could be an issue with your skeleton.

Basically what you see oj the right leg is a candy wrapper effect due to over rotation.
As if the bones are flipped 360deg plus whatever the IK is computing.

The other leg just looks like bad paint. Unrelated parts being pulled by the rotation?

1 Like

I’m gonna rebuild the skeleton and retry, I’ll let you know how it goes. All of the pictures of a twisted leg are of the same leg (I haven’t plugged the other leg into an IKTwoBone yet). Thank you so much for your help again, I appreciate your responses very much.

It may be an issue with skeleton’s joint axis. It will be easier to debug when we see joints and their orientation. Before applying rig (aka in reference pose) and after.

When building skeleton there are some conventions that UE likes to use. Like forward axis of a joint (axis that looks to it’s child joint) should be X-axis. If it’s not you’ll need to correct parameters for that (I’d say it’s a bad practice though)

1 Like

So, if I have y axis as forward it would cause a problem? If that’s the case, then I think that might be the reason for the issue I’m having. Thank you very much for your response. I still haven’t had a chance to rebuild the skeleton. I think I originally built it and then exported it from Blender as y axis as forward, so I’m pretty confident that that’s the issue. I’m not sure that these pictures are helpful or what you were looking to see so let me know if I should send more pictures, but here is a picture of the knee joint orientation before and after plugging in the IKTwoBone to the graph:


Unrigged^


Rigged^

Something definitely seems weird, but I don’t know enough about rigging to have a clue what it is. I’ll try rebuilding and reexporting the skeleton as x axis forward and see if that works, and I’ll get back to you as soon as I find out. Thank you so much for your help.

1 Like

Yes, that seems to be the issue here. Notice how in Rigged picture the joint is forced to orient X as forward. This behaviour can be tweaked in IKTwoBone node with parameter ‘Primary Axis’. Currently it’s set as X. Try to set it to negative Y (0,-1, 0) because this seems to be your reference pose’s forward axis for that joint. Secondary axis should be negative X then, but you may want to fiddle with that a bit.

But, the best solution still would be to reorient joints as UE prefers them in your DCC.

Hope this helps :slight_smile:

2 Likes

That did the trick! I just screwed around with different combos of x and y in both primary and secondary until I got one that worked. Everything looks good and is functioning properly :smiley: Thank you so much for your help!

1 Like

No worries :slight_smile:
Although, it’s a bit concerning that primary axis is the same as secondary. Hope that wont be a problem later down the line. Just keep it mind if something weird starts happening, haha xD

Cheers~

1 Like

I wonder…
Technically a leg (really most if not all joints) only has one axis of movement so i kinda doubt you need the secondary value set…

1 Like

That is true for the knee joint, but Leg-Torso connection is more of a ball socket type rotation, and IK effector’s location should control that as well.

The setting on the 2 bone node should only be relative to the main joint.
Not the attachment (thigh) joint.
Nor the end (foot) joint.

This all depends on how the beast needs to move anyway.
Since its not precise anatomy theres nothing to say that his/her knee joints dont allow 3 axis of alien impossible movement :stuck_out_tongue:

2 Likes

@kjvermilion Thanks for creating this thread. I am facing this exact issue for my rig as well. Also I am following the same tutorial as well to apply control rig.
My model has more than two bones per leg as you guys can in following images.

Green pointed leg looks okay after rigging.
Orange pointed leg looks okay but there are some twisting going on there as well.
Magenta color pointed leg is the messed up leg in all three.
Also please note that for other 3 legs on the other side, its the same scenario.

These are the control bone rotations after applying control rig.




And this is the IKTwoBone configuration for this messed up leg

And this is the export configuration from Blender that I am using

closer look at the issue I have

This is the control bone rotation without applying IKTwoBone

What I have tried so far -

  1. according to this thread I went ahead and fiddled with the Primary Axis and Secondary Axis Values.
  2. also earlier in my blender export settings forward transform vector was Y. But I changed it to X with what I understood from this thread.
  3. I tried rotating the bone along the Y axis and re parenting the skeleton to mesh. Please refer the below image.

@AyanMiru @MostHost_LA
Nothing worked so far.
At this point I’m bit clueless on what I can do. Do you guys see anything that I am doing wrong here? Any input will be greatly helpful.

So, it’s actually a little more complex than it seems.

First. Make sure the model is right.

For the model you need the bones to all be consistent (same rotation).
To do this in blender you align the initial bone of the chanin, then select all the bones in the chain and the tip last. Witn fhe tip highlighted brighter orange you adjust fhe rotation of the other bones by deriving from the selected.

If you want to follow a tutorial, look for anything that is handling fingers / superfinger / superlimb alignment.

Second is the export.
Y forward, Z up.
Experimental apply transofrms so in case you forgot its covered.

Thid is the node/rig in engine.
On that, i cant help too much since im not sure what’s up.
Either use control rig or the abp with 2 bone ik.
Probably not both.

What you are seeing is definitely candy wrapper effect from a twist.
If the export has the correct (standardized among limbs) axis, then the engine shouldnt try to rotate the bones that way…

1 Like

@MostHost_LA Thank you for your response and I’m sorry I couldn’t respond. I was stuck with lot of work.
I got a chance to take a look at the things that you have mentioned here.

  1. I am unsure how to check if the bone rotation is right or not?
  2. I tried exporting my model with Y forward and Z up with Apply transform enabled. Got the same results that I have right now.
  3. In the engine I am using control rig to rig the skeletal mesh.

I will try to search around this candy wrapper effect issue. Meanwhile please do let me know on your thoughts about checking the bone rotation.

Thanks again.

@MostHost_LA Alright,
I think clearly the bone rotation is the issue here. Again I went through the control bone rotations in the messed up bone hierarchies. The bones have different rotation along the Y axis. I’ve taken some reference images from start of the hierarchy to leaf bone.

Although I am not sure on how to fix this and verify in blender. I will investigate on that.

@MostHost_LA Okay it works. Thanks for the response again. I had to manually rebuild that entire leg bone hierarchy to keep consistent bone rotation. Below is the rigged leg after correct bone rotation.

Although I wonder if we have a way to correct bone rotation for an existing skeleton.

This thread was huge help when figuring out the problem. <3 @kjvermilion

You may need to enable a few options to see bone rotations.

This, in essence, is your issue:

The right solution for it did not seem to be mentioned so let me try and pull that… cant find a video… takes about 5 seconds to do.
https://docs.blender.org/manual/en/latest/animation/armatures/bones/editing/bone_roll.html

Recalculate roll while the chain is selected and the properly aligned bone is the active selection.
Selecting Active Bone as the source.

I remeber it being screenshotted for super-fingers in rigify since it is the most common issue you have with them and the automatic rigging… however it didnt come up as a search result…

1 Like

@MostHost_LA
Yea I was able to get visible axis of each individual bones using the following option.

And yes re-calculating bone role did the trick. It works perfectly. Thank you so much man. I was going nuts trying to figure this out.

2 Likes