#Ik Controls

1 messages · Page 1 of 1 (latest)

paper ivy
#

Does anybody know why this is happening
By the way setting LegBase.CFrame=LegBase.CFrame does it too?

The only thing I can think of is because of the 0.001 stud change that might happen between accessing the two .CFrames.


--IK Target
local IK_Target=workspace["IK Target"]
--Model
local IK_Prototype=script.Parent
--IK Controls
local LegBase=IK_Prototype["LegBase"]
local IK_L1=LegBase.AnimationController.LeftLeg1
local IK_L2=LegBase.AnimationController.LeftLeg2
local IK_R1=LegBase.AnimationController.RightLeg1
local IK_R2=LegBase.AnimationController.RightLeg2
--Raycast
local RaycastPart=LegBase["Raycast Parts"]
local RC_L1=RaycastPart["LeftLeg1"]
local RC_L2=RaycastPart["LeftLeg2"]
local RC_R1=RaycastPart["RightLeg1"]
local RC_R2=RaycastPart["RightLeg2"]
--IK Targets
local TG_L1=LegBase["Targets"]["LeftLeg1 Target"]
local TG_L2=LegBase["Targets"]["LeftLeg2 Target"]
local TG_R1=LegBase["Targets"]["RightLeg1 Target"]
local TG_R2=LegBase["Targets"]["RightLeg2 Target"]

--RC Filter
local RCFilter=RaycastParams.new()

RCFilter.FilterDescendantsInstances={IK_Prototype,}
RCFilter.FilterType=Enum.RaycastFilterType.Exclude

RunService.Heartbeat:Connect(function()
    local newPos = Vector3.new(LegBase.Position.X, 7, LegBase.Position.Z)
    LegBase.CFrame = (LegBase.CFrame - LegBase.Position) + newPos
end)
scarlet oar
#

What you’re seeing isn’t floating-point drift — it’s because you’re rebuilding the CFrame every Heartbeat, which breaks the original rotation and introduces tiny corrections each frame.
This line is the main problem: LegBase.CFrame = (LegBase.CFrame - LegBase.Position) + newPos LegBase.CFrame - LegBase.Position strips translation but reconstructs a new CFrame, so even if the values look identical, Roblox recalculates orientation slightly every frame → visible jitter. local rotation = LegBase.CFrame - LegBase.Position

RunService.Heartbeat:Connect(function() Even safer (no reconstruction at all) LegBase.CFrame = CFrame.new(
Vector3.new(LegBase.Position.X, 7, LegBase.Position.Z)
) * LegBase.CFrame.Rotation
local newPos = Vector3.new(LegBase.Position.X, 7, LegBase.Position.Z)
LegBase.CFrame = rotation + newPos
end)

Better approach

Cache the rotation once and only update position: Why LegBase.CFrame = LegBase.CFrame still jitters

Setting CFrame forces a physics + transform update, so Roblox still re-resolves constraints even if values are the same.

If this is IK-related, also make sure:
• Parts are Anchored
• No constraints / motors are fighting the transform
• This isn’t running on both client + server

old zealot
#

I think we should ban AI generated responses to help requests.

#

He also could have sent his problems to a LLM, and gotten the same response you sent him

#

But clearly he either already tried to, or just wants some help from real users

scarlet oar