The system is fairly simple in concept, and we use the IK nodes readily available in UE4. The most common mistake when doing foot IK is to think you should trace to the ground, then plant the foot where the trace hit occurred. This will work when standing still, but the walk is going to get messed up hard whenever the character moves, if it works at all. Instead, it’s more helpful to think of it this way: what if there were a height value that would allow me to offset the character’s feet upwards from the ground by a fixed amount? So let’s say I want to offset the character’s feet by 25 cm upwards, because this is an offset from the ground itself, my walk cycle should remain a walk cycle, it’ll just be a bit higher above ground overall and won’t spaz out all over the place. Once you have this functionality working, you just need to use it on each foot independently, by first tracing to the ground (I do it from leg in the direction towards foot), checking how high or low this is relative to your default height, and applying the offset.
To make things look good, it’s advisable to find the lowest ground between the two feet, then take that offset and apply it to the root of the character (so he dips a bit) and take this into account when computing the IK offset above.
Of course, lerp all the things to make the transitions smooth.
That makes total sense (I believe the Halo games started using this approach starting with Halo Reach, as each entire locomotion cycle aligns with the terrain). Ill have to attempt to implement this into my locomotion and animation system. I will say that I am fairly surprised that you are striving to achieve this level of animation quality for a first person game, but I’m very pleased! Its things like these that can add a lot to a game.