Hey guys, I’ve been kicking around ideas for how I could procedurally animate a set of legs for a spider mech, and I was curious if this kind of approach would work?
To start, this is the kind of effect I’m shooting for:
The idea is basically that all the ‘real’ gameplay animation happens to the mech’s body root while the legs are animated procedurally in Blueprint (and are purely a visual effect with no real bearing on gameplay). The ant GIF example above comes from a guy who set up the character in Blender and mentioned an idea that sounded viable.
Basically the concept is to have two sets of nodes/targets for the feet on each leg. One set would be anchored to the body root and translate/rotate locally with the body - these would be Rest Targets. The second set of nodes would be the ones dropped into world space (raycast project down to find a proper position on whatever terrain) and would be the Current Position Targets. Additionally, the distance between each pair of Rest and Current Position targets would be tracked. From there, the Current Position target would start in the same position as the Rest target, and as the mech’s body moved, the Rest target would move with it farther away from the Current Position. Once a distance threshold was reached (a number derived from how far the leg should be able to stretch), the Current Position would interpolate its position toward the current location of the Rest target over a few frames and start the cycle over.
I’m still wrapping my head around Unreal’s IK system, which is why I wanted to see in advance if anyone more experienced could tell me if this is at all feasible, if there may be a better way to go about this, or provide any tips.
Also, just to clarify, I created a mock-up animation in 3DSMax to illustrate my current line of thinking. In the GIF below, the Rest Target is green (anchored to the body) and the Current Position Target (anchored to the world until the distance limit is reached) is blue.