I’m trying to get the Owen_ExampleBP animation blueprint to constrain the right hand to the left hand through an IK. I’m using the ‘Get Socket Transform’ to get the right hand bone location in the Event Graph and then sending that location variable to the Anim Graph where the IK scripting is. However I can’t seem to get the IK to go anywhere other than Pawn or World space. I’ve tried the different options on the ‘Get Socket Transform’ node but it hasn’t changed anything. Anyone have any ideas or experience with this? Any help would be appreciated. Kind of a newb with blueprints.
Have you tried using a Copy Bone SkelControl in your AnimGraph? I think that will do what you want super easily. I did a quick example (copying a spine bone’s trans and rot to a foot ik bone):
Hi Ray, thank you for the reply! I tried out the copy bone skelctrl but I’m not sure if that’s what I’m after. That seems to snap one bone to the next rather than snap the IK?
I mucked around with the setup I had a bit more and got it to work. Though it seems like a simpler setup you might know of would cause a lot less headaches Also one that would show up in the preview window in the Anim BP would be awesome.
So for my convoluted way: In the character blueprint I’m getting the location of the left hand bone every tick and storing that. Back in the anim blueprint event graph I’m taking that location value (via a cast) and then converting the location variable (“LeftHandLocation”) to a variable I can use in the animgraph (“IKtargetLocation”) to plug into the IK skel controller. In the IK node itself I had to set the effector and joint target location spaces to ‘component’ to get it to attach.
Ah, sorry about that. I didn’t even think to mention using a bone to drive your IK. Basically, you can specify a bone as your End Effector (and set the Effector Location Space to Bone Space). So, we have bones in our skeleton just to use for this purpose (named like IK_Foot_R and IK_Hand_L). This allows you to use skelControls like CopyBone to move your IK to a certain bone and TransformBone if you want to move your IK to a specific point in space.
Note: you can also use a bone for the Joint Target. For foot IK, I would pick the knee joint and just give it some offset in the Target Location. Same thing for arm IK; use the elbow with an offset for the Joint Target.
What my settings for a foot IK look like:
All that said, nice work getting your method working! But, I think this way is a bit cleaner and a lot easier.
Oh jeez. I guess I took the long way. Right on the node is most definitely easier. Thank you again Ray!