Feel free to share a .rbxl in private via DM if you want so I can have a look, thanks.
Let me investigate whatās going on here, might be a peculiarity of when a motor is the root.
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.
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.
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.
repro.rbxl (37.4 KB)
Here is the place file used above
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
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.
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?
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.
Perhaps the property names could look something like this? Simple enough for everyone to understand at a glance
This is my current set-up and it is not working at all.
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.
- 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.
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.
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.
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 CFrame
s 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.
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.