Experimental Inverse Kinematic and Procedural Animations

Inverse Kinematics Version: Experimental Testing


(This topic was separated from the suggestion of a Community Sage)

I am releasing two modules that are mostly complete and generally only for more advanced scripters. (The other modules are linked below this thread)

Inverse Kinematics (sort of incomplete)

This IK solver is based on the FABRIK algorithm which I was able to get working with conventional bones in Unity and Unreal Engine. To preface this section, this is currently not a replacement for your current rig setups. I have not found a way for it to accurately work with Motor6Ds yet due to my inexperience working with those particular objects. This is why I am abandoning the system since no one was able to help me on the issue. It comes feature-complete with pole targeting and chain length. Expect bugs since it is incomplete (not as much though since it’s pretty much tested). This module is meant for learning the algorithm and using it for your own work.

It also includes an incomplete procedural animation creature to showcase how it works.

Sample IK Solver Module code
local ChainLength = 3
local RootLimb = workspace.Creature.LeftForeLeg.Knee.Foot

local IKLimb = IK:CreateIK(RootLimb, ChainLength)

IKLimb:SetTarget(workspace.Target)
IKLimb:SetPole(workspace.PoleTarget)
IKLimb:Update()

Procedural Animations

Procedural animation is an alternate way of animating your rigs. Instead of using conventional keyframes, you will tell the computer where to move the limbs instead. It is also different from conventional CFrame animations because they aren’t set in stone either. The procedural sample creature that the IK solver comes with uses the most basic knowledge of procedural animation logic. It is far from smooth or perfect, but the way to do it is the same.

The IK Solver is great as it automatically positions where I want my limbs to rotate. I would then raycast downwards from where my creature foot is to see where the ground is, and place the target in the position of the ray. My Pole Targets are parented to the body of the creature so it will always stay in the right place. When the creature moves, the targets will also move along with it. The foot will stay planted until the targets get too far. Then we can adjust the foot to move to the new target position. This creates the “walking” animation. This is just one example of what you can make with procedural animations.


You can get the IK solver alongside the creature here. Alternatively, you can download the place file here containing both my pooling system and IK w/ creature. Scripts are in workspace.
PoolingAndIK.rbxl (27.5 KB)


My other modules:
Raycast Hitbox Module
Part Pooling - Increase performance with lots of parts

193 Likes

This is AMAZING. My mind popped when I watched the video. I cannot WAIT to try this out.

11 Likes

You’re really making a streak of amazing modules on ROBLOX, i must say. Your raycast hitbox module proved to be a great foundation for one of our games and I can be the same being said about this.

My friends and I love seeing the modules you put out, thank you for being so generous as to continue providing the community with these resources!

Looking forward to playing around with the solver and seeing what can be done.

10 Likes

FABRIK works with Joints (Like Motor6D and Welds)?

4 Likes

Its an algorithm so it works with everything. This example doesn’t contain a working motor6d or weld implementation. That will be your job. This is merely the algorithm.

6 Likes

This is quite cool.

I’ve been working on my own system for a couple months now and you nailed this out of the park. My only regret is that I didn’t come across this sooner.

Thanks for sharing!

4 Likes

70 Likes

This helped me create IK/Procdural animation for R15!

Thanks so much for helping me understand how it works :slight_smile:

If you’re scrolling by, over here is the system up for grabs.

9 Likes

The job has been completed, the FABRIK algorithm has been implemented to work with Motor6D’s.

Insert my shameless plug in to my thread link:

More features currently underway such as constraints and procedural animation support.

Thanks a lot for the inspiration!

5 Likes

I feel like the creature could be improved if the body was unanchored and moved with body forces and such, what do you think?

2 Likes