For example, I need triggerable events in my game where the player gets control over how the character’s skeleton moves. Specifically, let’s say one of these events allow the player to wave their character’s hand using the mouse. Not worrying about the specifics of detecting how the mouse is moving in relation to progressing the animation, how would I be able to achieve this? Assume I have a solution to calculating what point a player should be in an animation, and that I have an animation of the character in question waving their hand as I would like from left to right.
How am I able to translate a value that I calculate to a specific point in an animation? (If the mouse is moved to the left, the character’s hand moves to the left; if the mouse moves right, then the character’s hand also moves right.)
Though I unfortunately do not have the time to test this now, over the next few days I will attempt to use a FABRIK node to see if I can accomplish what I’d like to accomplish. Through the brief research I have just done on the node, it appears as if this is what I may be looking for.
So, to clarify, I’d be able to put my character in a “resting pose”, and then use the FABRIK node to control a specific bone and manipulate it as I would like, and that’ll adjust the rest of the bones surrounding it? I am assuming that I’d be able to define which bones I’d like to manipulate using FABRIK, and which ones I’d like to leave alone? (For a goofy example, if my reference pose is of my character leaning over slightly with his hands resting on a table, I’d be able to control his head while leaving his hands and feet planted where they are, right?) If I am able to lock specific bones so they don’t move (like hands and feet), how exactly would I go about accomplishing that in regards to FABRIK?
I see something in the UE4 documentation about a “root” and “tip” bone. I assume this is defining the chain that you’d like to use FABRIK with. Would I be able to use multiple FABRIK nodes per mesh if I’d like to control more than one full limb at once, or as in the head example, define what bones I’d like to exclude from the manipulation and lock in their original positions?
I am relatively new to working with skeletal meshes, animations, and IK in UE4, so I apologize for the demanding specificity.
There’s the Transform(Modify)Bone node if you want to control a single bone. You can pass in where you want the bone to be or how it should be rotated.
But I think you’re going to want to use a FABRIK node. That will move a bone and adjust the other bones so it looks natural. It’s called “IK” (Inverse Kinematics) and it’s pretty heavy stuff. There are lots of tutorials on IK though.
For the head, the Transform(Modify)Bone node might be sufficient. But if you wanted to get the neck to rotate as well you’d either want to Transform(Modify)Bone that too (divide the rotation in two and apply separately) or use a Two Bone IK node. FABRIK would be overkill I think – unless it helped turn the shoulders a little, I don’t know.
A good example of FABRIK is getting the left hand to grip the right spot on a rifle no matter where the rifle moves to.
Yes, you specify the tip and root. The root is the final joint. So for the rifle example, the tip would be hand_l and the root would be upperarm_l or maybe clavicle_l. Then you specify the right_h bone as the effector target. Then you give it an “effector” which is a transform that will control the tip bone. Check out the rifle grip tutorials to get a better idea.
Yes, you can have multiple FABRIK nodes per animation. I actually use two for my rifle. One for the left hand grip and the other to raise the rifle to aim down sights.
In fact, that leads to a good example of dynamically affecting the bones from the character BP: recoil.
I have an offset transform that I use to modify the right hand FABRIK effector. I get the offset from my character BP, where I use a timeline to drive the offset every time the weapon is fired. The right hand shudders around and the right arm IK adjusts to compensate. Of course, the other FABRIK node keeps the left hand where it should be. This gives me an absolutely gorgeous dynamic recoil effect. It’s so much nicer and more flexible than using a recoil animation. You can basically do the same kind of thing for waving a hand with the mouse.
With the information that you’ve provided and what I have seen in my research of the node, I feel confident in marking this question as solved. I am really happy to hear that I’ll be able to use multiple FABRIK nodes for one character because that will allow me to do exactly what I’d like. Now, I just need to worry about implementing the movement detection and calculations with the FABRIK system which will be a challenge in its own, but nothing I don’t feel comfortable in claiming that I could manage.
I am very grateful that you were able to point me in the right direction here; it is immensely appreciated!