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
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.
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)
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
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.
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
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.