Inverse Kinematics Control Instance for animation is now in Beta!

Feel free to share a .rbxl in private via DM if you want so I can have a look, thanks.

2 Likes

Let me investigate whatā€™s going on here, might be a peculiarity of when a motor is the root.

2 Likes

replied to @PeZsmistic, this is the same issue of forward kinematics being updated by physics after the Stepped event. Also interested in knowing your thoughts on which solution mentioned you think would be more appropriate or if you have other suggestions. Thanks.

I love this, shared in our internal IK channel and all the devs are very impressed.
Agreed, the EndEffector alignment offset is something weā€™re adding, development is completed and will be added in 1-2 weeks likely under the name AlignmentOffset (or some better name, suggestions welcome).
The integrated smoothing/damping is not something we originally planned but seeing several devs asking for it itā€™s something we are now considering and experimenting with.

3 Likes

Just a quick suggestion, it would be better if you could instead point the target to a CFrame instead of a instance. This makes it easier for things like pointing to your mouse, etc.

2 Likes

The blue arm has no IK enabled, the red one does. At the start of the video, the root CFrame is at 0,0,0. It seems impossible at the moment to move a custom skinned mesh with IK freely around the world currently.
This is still an amazing feature and I canā€™t wait to see what everyone does with it. I should note that I can get R15 IK working just fine. The arm bones here are named in R15 style.
image

repro.rbxl (37.4 KB)
Here is the place file used above

6 Likes

All I have is three parts, stacked on top of each other in a group. Then I put an AnimationController in it with an Animator parented to the controller. Then I inserted the IkControl into the controller and set the properties. I would like it to behave like a tentacle and bend with each piece, but currently, only the top part is doing anything. It either doesnā€™t work period, or only the LookAt mode works and points the top one extremely crudely.

My actual issue was the fact i didnt understand how the ā€œIKControlā€ object worked.
This guide should help. Inverse Kinematics | Roblox Creator Documentation

1 Like

I think it would be much less of a hassle to work with if all of the world CFrames were exposed on only the one animator instance. If it was attached to the Motor6D then I would need to set the IKControl explicitly on the Motor6D so I can make sure I always have the correct reference to it, which is a little error-prone and needless IMO.

Poster below makes a great point though.

2 Likes

WorldCFrame is definitely the better option imo, tying something like that into an animator isnā€™t great as it limits the usability of motors outside of specific rigs using a humanoid/animationcontroller, although I wouldnā€™t be opposed to that as an additional option.

edit: also echoing pezsmistic, I think endeffector could use a more clear name, maybe ChainEnd/ChainTail to match with ChainRoot?

5 Likes

Thank you!

There was something here about a problem I was having but it turns out I forgot that I turned on the unfinished spring stuff before bed last night and I am in fact big dumb.

Might suggest EndEffectorOffset instead, itā€™s more clear that it relates to where the end of the endEffector is. Might also suggest renaming EndEffector honestly because this sounds like a research paper / algorithm name moreso than something developer-facing, but itā€™s not too important, it just might make for easier use + naming of other properties.

2 Likes

Perhaps the property names could look something like this? Simple enough for everyone to understand at a glance

Example

4 Likes

This is my current set-up and it is not working at all.

image

I am still not getting the results I want. I did test it out with a dummy andā€¦ it works? It just looks really stupid.

IK Demo.rbxl (147,1 KB)

Hereā€™s a little demo of what Iā€™ve written for rig-agnostic IK footplanting and surface matching (albeit the surface matching is a little bit of a hack in my custom rigā€™s awkward setup, but you can get it to work for yours too by pre-planning for it in your rig with a node between the root and the upperbody to act as the IK ChainRoot).

The file contains a default blocky character, my character, and a stripped version of one of my custom characters. You will need to reupload the walk animation and plug it into the animate script if you want to see that one working.

In body parts that should be IK driven, you should include an ObjectValue named IsIK. The Value property should be the ChainRoot, while the basepart you put IsIK inside of should be the EndEffector. IsIK will be directly translated into an IKControl instance.
image

  • Enabled is a debug property to prevent that IKControl from being created.
  • Reach is how far the limb can extend beyond its un-animated resting pose, or how far the IKControl will search beyond the characterā€™s height for the surface below.
  • Type is one of Leg, Body, and LongBody, this influences how the IK behaves,
    • Leg will guess when the foot is planted and place the IK target on the ground along a raycast from above the EndEffector at rootpartā€™s Y position to the EndEffector.
    • Body will set the IK to rotation mode and will match the orientation of the body to the orientation of the floor immediately below the rootpart.
    • LongBody will set the IK to rotation mode and will match the orientation of the body to the orientation of the floor, but it will average 2 raycasts from the front and back of the rootpart to smooth the orientation a little bit.
  • Weight is the IK influence of the IKControl.

This code is currently local only. You can get this to apply to the default character as itā€™s loaded in by setting up the IsIK instances in a script that runs before this script is run. You can probably put this script into a module that returns a function that you call when setup is complete.

This code is a little bit rough and disorganized, and does not work perfectly in all cases. Itā€™s missing angle limiting and itā€™s missing smoothing and has some excellent failure cases. I would probably do the smoothing with a few springs that ease the target to the correct position, instead of immediately setting the target position.

This code is provided as a reference, but you may use it in part or in whole in your finished games. I cannot provide in-depth tech support with this code, but I can answer small questions.

@AstroCode helped with generating the pure animation Motor6D graph.


If it is helpful @sg3cko I can provide a couple of character models that do not work with this system due to old manually done rigging that doesnā€™t follow IKControlā€™s expectations. Just let me know and I can DM them.

26 Likes

Iā€™m having trouble getting bones to work. I have two leg bones that I want to point to a part. No movement is made, and I have triple-checked the IK Controls.

image

The rig uses Motor6Dā€™s yes. But this is a rather unique set up as the rig is a hybrid of both bones and Motor6ā€™s

Blue areas are skinned meshes that use bones to articulate. Everything else is connected via Motor6. I apologise for how messy it looks but it is a rather complex rig.

Red areas are areas that Iā€™ve attempted to connect to the IK system.

For the head IK, this is the set up

And for the armsā€¦

The Effectors are set to the mesh parts as stated in the guide. No parts are anchored apart from the HRP. Sometimes if Iā€™m lucky the motor attached just forward of the last effector will move. In case of the hands, this is one of the fingers strangely enough. Iā€™ve tried setting the target to both attachments and parts. Neither have resulted in particular success.

1 Like

Good suggestion. Currently you can achieve that behavior by using the Offset property that takes a CFrame. I donā€™t think itā€™s possible to have a property accept both CFrames and references to Instances, but there might be a way around that to allow assigning a CFrame directly to Target.

This is definitely an issue on our side, let me investigate. Thanks for the report and place file.

4 Likes

Itā€™s hard to say what the issue is without more details, it might be an issue in how the Motor6D are setup between the parts. Parts need to be connected correctly for them to work with IK.