By using the calf as your IkFootBone you’re just telling the foot to follow the calf.
I usually use the LegIK node in order to drive other joints position to an existing joint ( like IK_hand_l to follow the hand_l joint ).
Using the good old Two Bone IK allows you to do pretty much whatever you want.
Thank you for your reply. I did try using 2 bone IK but for some reason it completely breaks the animation. I can’t work out why this happens. With LegIK the animations are still working fine.
2 bone IK:
LegIK:
My 2 bone IK settings:
You should do a trace from the pelvis joint to the ground, then on Z subtract the height of the foot joint from the ground ( save that as a variable on begin play, or set it manually by checking the height of the foot when the character is on A/T Pose ).
From there cas to the AnimBP and set just the Z value for the effector location, while X and Y I suppose are coming from a state machine with animations.
By doing so you’re still able to use the animations, but you provide the proper feet height based on the tracing.
Sorry I probably confused things in the last message. I’ve already got the pelvis height working ok, it’s just disconnected in these gifs as I wanted to highlight the difference between the walk animation when using LegIK vs 2boneIK.
With the 2 bone IK (first gif) you can see the legs don’t move properly, I think maybe I need to dynamically set the effector and joint target based on the animation data?
With LegIK you’re just setting the feet height, while with TwoBoneIK you’re doing an override of the feet location, that’s why you’re seeing the animations being played in that way.
I’m about to do exactly what you’re doing for legs locomotion, but in my case I’ll use a separate skeletal mesh which will give me the locomotion data, while the main skeletal mesh will use IK, where using TwoBoneIK the Effector XY data will come from the other skeletal mesh animation, and Z will be calculated using line trace.
This has nothing to do with actual leg IK.
One would think that the very first step has to be to actually get the math in order.
Without that, what is being attempted has no sense what so ever.
Read up on how leg ik is done - and more importantly how the hip is handled.
The way the hip is handled changes between standing - where its always at the tallest point of one leg or another - or crouching - where the hip is more free-floating (in a pinch the same math would work ok given a decent base animation).
Using leg ik is perfectly fine if you set it up correctly in the properties section btw.
The main difference between the nodes is that some allow for a pole vector to handle the mid joint rotation, some do not.
And well, some solvers like cckid are faster/less computationally heavy than others like fabrik - but its the equivalent of splitting hair…
Ok the solution was actually just to use two bone IK and virtual bones for the feet.
Virtual bones control the XY position of the effectors and a line trace sets the Z of the effectors, this allows the IK system to control the height of the foot with the virtual bone unaffected which meant the XY still has the correct locations from the walk cycle and can be combined with the Z.
Vid here explain it more UE4 Walking Animation With IK(Using Virtual Bone) UE4Tuts For You#UE4tuts#UE4#UE4IK - YouTube
Thats not how IK for locomotion is supposed to work.
Your HIP shifts up and down too when you pass over objects. You dont just keep your hip fixed on Z and glide across things like … I really have no idea what an example of this would even be…
Ok well an example of this would VR locomotion which is what I’m setting this up for… I don’t want the hip moving or it will cause the player camera to shift up/down which would cause motion sickness. The legs need to move with the walk animation and but also bend when the player crouches in real life. The leg IK is required because the when player crouches in real life the root bone of the skeleton follows the camera Z location and gets moved closer to the floor and legs IK updates.
Glad you got it working exactly as you wanted
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.