IKControl Joint Constraint [Beta]

This issue should be fixed now, let me know if you see anything else like it

1 Like

Thank you! This was the last thing preventing me from adopting IKControl.

There is one last funny detail with that repro file that I just wanted to mention. Probably preventable with some constraint finagling, but it’s still unusual since the IK assembly should be eased to the final position, instead it does this in difficult to solve scenarios. If I set the pole to the middle joint then this happens a lot more, when I would expect it to choose a “close enough” state.

1 Like

Should I make a feature request regarding this and the use cases so that this can get higher priority? Right now for R15 constraints I’m using a very forked version of the RagdollRigging CoreScript to generate realistic ragdolls.

I’m trying to recreate an arm using IKControl and have ran into an issue. Whenever the arm is completely straight it doesn’t follow the TargetPart properly. I have a HingeConstraint that limits the elbow from bending improperly and when it’s removed, it seems to work fine minus the elbow bending weirdly. I’ve attached a video for clarity:

Not sure if anyone else has had this issue or if it’s caused from my setup. Here’s a place file to look at my setup:
IKControlBug.rbxl (60.5 KB)

Hey guys, do you know if it’s possible to implement these kinds of constraints on a skinned mesh like my wolf model?

We’d like to create foot planting. Thank you.

1 Like

last time i checked it was possible as it supports both bones and motor6ds

Did you ever get around to creating that test place? I’m having a hard time figuring out where my attachments need to be and whatnot, and how to position them with a custom character and bones.

1 Like

at least the gun points in the right direction, but how to fix it so the amongi doesnt go upside down

My character’s arm shakes violently when I add a HingeConstraint to its rig attachments, but only when I’m not moving.

Am I doing something wrong?

1 Like

Was something changed about IKControls in the past year? I have a free model script I made last year that no longer works even though I haven’t changed anything. It was previously working fine.

This is what it used to do:

However, when using it now, nothing happens. From what I can tell, it no longer works because something changed related to IKControl instances. Not sure what it is, but something seems broken when trying to use UpperTorso in the chain.

IKMoveDirection.lua (3.3 KB)

Source Code
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local function onCharacterAdded(character: Model)
	local humanoid = character:WaitForChild("Humanoid", 4) :: Humanoid
	if humanoid then
		local currentRunningSpeed = 0
		
		local function updateIKMoveDirection()
			local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
			if humanoidRootPart==nil or humanoid:GetState()==Enum.HumanoidStateType.Dead then
				return
			end

			local moveDirectionAttachment = humanoidRootPart:FindFirstChild("MoveDirectionAttachment") :: Attachment
			if moveDirectionAttachment==nil then
				moveDirectionAttachment = Instance.new("Attachment")
				moveDirectionAttachment.Name = "MoveDirectionAttachment"
				moveDirectionAttachment.Parent = humanoidRootPart
			end

			local IKControlForMoveDirection = humanoid:FindFirstChild("MoveDirectionIKControl")
			if IKControlForMoveDirection==nil then
				IKControlForMoveDirection = Instance.new("IKControl")
				IKControlForMoveDirection.Name = "MoveDirectionIKControl"
				IKControlForMoveDirection.Type = Enum.IKControlType.Rotation
				IKControlForMoveDirection.Parent = humanoid
			end
			
			local moveDirectionLimitRoll = script:GetAttribute("MoveDirectionLimitRoll") or NumberRange.new(-15, 15)
			local moveDirectionLimitTilt = script:GetAttribute("MoveDirectionLimitTilt") or NumberRange.new(-15, 15)
			
			local moveDirectionIntensity = math.min(currentRunningSpeed / humanoid.WalkSpeed, 1)
			local walkDirection = humanoidRootPart.CFrame:VectorToObjectSpace(humanoid.MoveDirection)
			local currentRoll = math.abs(walkDirection.Z) * moveDirectionIntensity * (if walkDirection.Z<0 then moveDirectionLimitRoll.Min else moveDirectionLimitRoll.Max)
			local currentTilt = math.abs(walkDirection.X) * moveDirectionIntensity * -(if walkDirection.X<0 then moveDirectionLimitTilt.Min else moveDirectionLimitTilt.Max)
			
			IKControlForMoveDirection.SmoothTime = script:GetAttribute("MoveDirectionSmoothTime") or 0.2
			IKControlForMoveDirection.Priority = script:GetAttribute("MoveDirectionPriority") or 0
			IKControlForMoveDirection.Weight = (script:GetAttribute("MoveDirectionWeight") or 1) * moveDirectionIntensity
			
			moveDirectionAttachment.CFrame = CFrame.Angles(math.rad(currentRoll), 0, math.rad(currentTilt))
			
			local IKPart = character:FindFirstChild(if humanoid.RigType==Enum.HumanoidRigType.R6 then "Head" else "UpperTorso")
			IKControlForMoveDirection.Target = moveDirectionAttachment
			IKControlForMoveDirection.ChainRoot = IKPart
			IKControlForMoveDirection.EndEffector = IKPart
		end
		
		humanoid.Running:Connect(function(runningSpeed: number)
			currentRunningSpeed = runningSpeed
			RunService.PreAnimation:Once(updateIKMoveDirection)
		end)
		
		humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(updateIKMoveDirection)
		task.spawn(updateIKMoveDirection)
	end
end

local function onPlayerAdded(player: Player)
	player.CharacterAdded:Connect(onCharacterAdded)
	if player.Character then
		task.spawn(onCharacterAdded, player.Character)
	end
end

Players.PlayerAdded:Connect(onPlayerAdded)
for _,player in Players:GetPlayers() do
	task.spawn(onPlayerAdded, player)
end
3 Likes

Same, my gun system which was relying on the IK controls / functionality now it’s offset and doesn’t seem to align like before

I have noticed similar behavior with using a very simple rig. Could it be you’re using the new Pole property? It was made “functional” recently. I’ve noticed that it seems to create this strange behavior where it’s rapidly switching between two IK solutions. I’ve attached a very simple file. If you move around the attachment on the constrained leg, you’ll notice this a lot. Turn off the pole and it doesn’t happen. Weird huh. Additionally it tends to ignore the smooth time a lot too.
leg ik.rbxl (60.4 KB)

I am in need of a tutorial on how to setup constraints with bones, can’t figure out how to make it work
Edit: oke I figured out why it doesn’t work on my case lol, I put the wrong attachment in the constraints

i hope that we could have IK in R6 animator, thats faster than open blender and set up make animations

BUG


There bug with ik it’s broke my animation and when i check the animation it’s not show me and it’s not loadded the character body

[the animation should be like this]

image

and all my animation that i made it in this character is gone