IKB - Inverse Kinematics Bundle

IKB

Simple, Lightweight, and Performant IK Bundle

About :placard:

As the name implies, it’s an I nverse K inematics B undle, containing modules for common IK implementations, currently supporting R6 and R15 rigs, with more coming soon!

Purpose :performing_arts:

Makes IK simple and easy to implement for common use cases with little to no knowledge about the math and logic behind the library itself, as well as keeping itself lightweight, and causing little to no impact on the CPU.

Performance :zap:

Module Method Runs Calls Avg. Runtime
R15.AL :Solve() 1,000 10,000 28.1ms
R6.Arm :Solve() 1,000 10,000 18.0ms
R6.Leg :Solve() 1,000 10,000 14.5ms

Credits :medal_sports:

Installation :building_construction:

Source :scroll:

Getting Started :open_book:

R15
local R15ALIK = require(script.IKB.R15.AL) -- "AL" stands for "Arm & Leg".
local LeftArmIK = R15ALIK.new(Character, "Left", "Arm")
LeftArmIK.ExtendWhenUnreachable = true -- Move body part when it normally cannot reach (do not include this line if you don't want this behavior).
LeftArmIK:Solve(Target.Position)
R6
local R6ArmIK = require(script.IKB.R6.Arm)
local LeftArmIK = R6ArmIK.new(Character, "Left")
-- Note: R6 does not support "ExtendWhenUnreachable" behavior yet.
LeftArmIK:Solve(Target.Position)

Example.rbxl (42.8 KB)

License :judge:

MIT License

116 Likes

Wow! This simplifies a lot for me! I’ve always struggled to implement IK in quite a few instances so thanks for this!

Also +1 for the MIT license!

1 Like

Looks great, does it support animations?

Could you elaborate on this further? You could animate the rig and leave the parts that you want to use for IK.

I believe its called animation blending iirc, but yeah that works for my purpose too. Great module

1 Like

R15 Support + Minor Optimizations

Version: 1.0.0 → 1.1.0
Scale: Minor

Changes :chart_with_upwards_trend:

  • R6 leg solver is slightly faster thanks to CFrame creation optimizations.
  • Removed redundant variable in R6 leg solver.
  • R15 Arm & Leg (AL) solver has been implemented.

Known Issues :bug:

R6 solver has some edges cases where it throws wonky output. If anyone knows how to fix let me know as I am not an expert when it comes to inverse kinematics.


Learn more by visiting the GitHub repository.

I had the same problem using R6 IKPF (Inverse Kinematics Procedural Footplanting)
Basically at certain angles, the legs were wonky or weird looking. This is because the IK method they were using was:

So my best guess why the legs doesn’t solve perfectly is because of your IK solver.
(Correct me if I’m wrong)

i hope this helps in any shape or form.

1 Like

Where should you put the scripts?

In any place you want. I personally recommend to put them in PlayerScripts since you won’t be solving IK on the server.

Destroy Method Fix

Version: 1.1.0 → 1.1.1
Scale: Patch

Changes :chart_with_upwards_trend:

  • R6 leg and R15 AL solver now restoring C0 CFrame of joints as intended when calling the :Destroy() method.
  • R6 arm now properly restoring C0 CFrame of joints when calling :Destroy() method.

Learn more by visiting the GitHub repository.

1 Like

Very cool, This can be used for IKPF right? i mean it should be

It should, I don’t see why not.

What would be the best way to do so? I’m new to Inverse Kinematics and procedural footplanting.

That’s something you can ask in #help-and-feedback:scripting-support, this thread is only for IKB related problems and questions.

1 Like

Is there any a way to make this work with lightsaber system while use ik feature that able to track the mouse cursor?

Can you elaborate more on what you want to achieve? Do you want the hand that is holding the lightsaber to follow mouse position?

1 Like

Yeah but follow the mouse while the lightsaber is enabled but if it not enabled it will not follow the mouse

Here is a sample to get you started, it’s not completed but it should give you some idea on how to implement this module in your project. If you need help with the logic then you should go and ask in #help-and-feedback:scripting-support.

local RunService = game:GetService("RunService")

local R15ALIK = require(script.IKB.R15.AL)

local leftArmIK, rightArmIK, heartbeatIK

local function toolEquipped()
	leftArmIK = R15ALIK.new(characterModel, "Left", "Arm")
	rightArmIK = R15ALIK.new(characterModel, "Right", "Arm")
	
	heartbeatIK = RunService.Heartbeat:Connect(function()
		leftArmIK:Solve(targetPosition)
		rightArmIK:Solve(targetPosition)
	end)
end

local function toolUnequipped()
	heartbeatIK:Disconnect()
	
	leftArmIK:Destroy()
	rightArmIK:Destroy()
end
1 Like

For r6 - How do I make animations not play while it is active because the arm seems to move when I walk or stand still. I also want to offset the shoulder position but I’m not sure how to do that. I want it to offset because the hand currently doesnt reach the attachment position of the weapon handle.

1 Like

That’s something you have to ask in #help-and-feedback:scripting-support

I am not sure, but I might look into it at some point.