I’ve been working on a ratchet project for a very long time and have stumbled upon the IK system. And i’ve been trying to think of all the possible and optimal solution. Even the easier way like Find look at rotation and getting angles from 2 vectors (In my case is From a socket location attached to the upper foot and to the impact point) I’ve tried to rotate it based on the angle of the surfaces, but i didn’t think about the different heights and stuff.
I’m going to transform some of my node setup, since I am originally using this to drive the player’s rotation to match the floor rather than driving the foot to match the floor; so bear with me. I don’t see why this would not work for any component. In the case of a first person view, it will prioritize aligning the Z vector first but try to keep the X vector as close as it can. So the foot should always appropriately face forward.
Well, i kinda expected this from working with the surface normals.
It goes back 90 degress once it hits a flat floor. I want it to dynamically rotate the leg sideways so that the foot is on the flat part.
What does the foot rotation look like if you zero out the bone. It may be that the bone’s z axis isn’t actually up relative to the floor space. Actually, if you can give me a screen shot of the UE4 skeleton asset scene with the foot bone selected (and widget set to local space (top-right of the viewport)), I’ll be able to tell right away what axis you need.
Anyways…if this is local space, it looks like you have Z axis forward, X axis up, Y axis right. These might be rolled over on the foot bone but I digress.
Back in that snippet of blueprint, you need to change the “getForwardVector” to a “getUpVector”, and change the “makeRotFromZX” to a "makeRotFromXZ. The trace’s normal wire plugs into X (this is your bone-space Up) and the getUpVector plugs into Z (this is your bone-space forward). You may have to multiply the getUpVector by negative 1 because it looks like it’s pointing backwards.
I think it’s weird that we got different axis out of blender skeletons but oh well. (I have Y forward, but I tried to get X forward, Z up out of export options; didn’t help).
Oh, and your move and rotation widget’s axis are actually the same. And, to be honest, it looks like the world space widget.
Aye I was worried something like that might happen. I’m going to test on my end before I respond this time. I’m thinking the foot bone needs a saved default rotation that the normal can then be added to so that it’s not adding to itself.