CCDIKController - Alternate inverse kinematics method for Motor6D rigs

Sorry unable to replicate within the test place provided in my GitHub.

Are you using the latest CCDIK controller? This should have been fixed since this update post.

Otherwise please dm me your repro file so I can diagnose further.

3 Likes

Hello! Your module is really interesting and helped me out a lot!
I just have one question, after a part of the character finishes iterating, how would I go about putting it back into it’s original position? I’m making my game so I replace traditional animations with procedural ones. I’m just struggling to figure out how to put my arm back, if I extended it to reach and push a button?

2 Likes

For other people that can’t translate it, here ya go!

local Body = workspace.Body
local Leg = workspace.Leg

local Offset = Vector3.new(0,Leg.Size.Y / 2,0)

local currentPosition = Leg.Position
local newPosition = Leg.Position
local oldPosition = Leg.Position

local stepHeight = 1.5
local stepDist = 2
local speed = 5
local lerp = 0

local Params = RaycastParams.new()
Params.FilterDescendantsInstances = { Leg }

-- Had to modify this part a bit
local function Update(dT)
	Leg.Position = currentPosition + Offset

	local Result = workspace:Raycast(Body.Position,Vector3.yAxis * -500,Params)
	if Result then
		if (newPosition - Result.Position).Magnitude > stepDist then
			lerp = 0
			newPosition = Result.Position
		end
	end
	if lerp < 1 then
		local Goal = oldPosition:Lerp(newPosition,lerp)
		Goal += Vector3.new(0,math.sin(lerp * math.pi) * stepHeight,0)

		currentPosition = Goal
		lerp += dT * speed
	else
		oldPosition = newPosition
	end
end

while true do
	local dT = task.wait()

	Update(dT)
end

10 Likes

The documentation is no longer working. Is there still a tutorial?

The tutorial should still be there, just the hyperlinks in the inital page are broken:

https://datlass.github.io/Rbx-CCDIK/BasicSetupTutorial/

Prolly wont fix it, no motivation and the Github website files are missing.

FIX IT GRRR.
No but seriously, it would be very nice.

1 Like

Can this be used while using the animator built into studio? This is something that I could really use as the built in IK controller is limited and very broken.

can someone help me making this look good i added constraints but its worse now

https://gyazo.com/c26902560df0ebc6f98394085a38c125.mp4

Great module, I managed to get it to work with a viewmodel!
But the arm wont fully rotate like the target’s orientation, Is there any way around this?

External Media

Here’s the code/setup (520.1 KB)

1 Like

i get a feeling that the ccdikcontroller itself is broken nowadays

Hey, I tried using this module but for some reason using 2 arms/legs just makes them move and drift off of the joints.

--[[
    R15 with constraints and animations
]]
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CCDIKController = require(ReplicatedStorage.Source.CCDIKController)

local dummy = workspace.HumanMale_Model
local leftTarget = workspace.newTargetConstraints

local dummyMotor6Ds = {}

local dummyDescendants = dummy:GetDescendants()
for _,descendant in pairs (dummyDescendants) do
    if descendant:IsA("Motor6D") then
        dummyMotor6Ds[descendant.Name] = descendant
    end
end

local upperLeg = dummyMotor6Ds["LeftShoulder"]
local knee = dummyMotor6Ds["LeftElbow"]
local foot = dummyMotor6Ds["LeftWrist"]

local r1 = dummyMotor6Ds["RightShoulder"]
local r2 = dummyMotor6Ds["RightElbow"]
local r3 = dummyMotor6Ds["RightWrist"]

local leftLeg = {upperLeg,knee,foot}

local rightLeg = {r1,r2,r3}

local leftLegController = CCDIKController.new(leftLeg)
leftLegController:GetConstraints()
local rightLegController = CCDIKController.new(rightLeg)
rightLegController:GetConstraints()

--Stepped for the CCDIK to reset the .Transform property
RunService.Stepped:Connect(function()
	leftLegController:CCDIKIterateOnce(workspace.M4A1.Grip.Position,0.04)
	rightLegController:CCDIKIterateOnce(workspace.M4A1.BarrelHandle.Position, 0.04)
end)

This is what it looks like and the entirety of my code

could you please explain to me how did you make the door cuz i tried and the arm wont do anything please help and thank you

hello, you should use the IKConstraints that roblox released; theyre easier to use.

2 Likes