IK Controller Constraints?

I’m working on a fully IK character controller and am running into an issue where I can’t force the arms to stay down and not bend weird.

Usually with IK, you’d have a second constraint that directs the bones in a direction (kind of like multiple points on a Bezier curve)

What you’re thinking of is a Pole, it’s the part of Inverse Kinematics that acts like an offset and tells the IK how to bend. You need to set the pole via code.

Here’s a basic premise, note these are from a table so in your case just set the ikControls[1] to you’re ikControl location.

ikControls[1].Pole = -- Part here

For a better view here’s a instance for the IKControl

local ik = Instance.new("IKControl")
ik.Parent = character:FindFirstChildOfClass("Humanoid")
-- or "AnimationController" if your character has that
ik.Type = Enum.IKControlType.Position
ik.EndEffector = character:FindFirstChild("LeftHand", true)
ik.ChainRoot = character:FindFirstChild("LeftUpperArm", true)
ik.Target = workspace.target -- an Attachment or BasePart you created
ik.Pole = nil -- optional part to indicate the bend of the elbow

Any other questions let me know!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.