Helloo, facing difficulties with IK as well? Same…
Yeet my IK broke
Some questions I have.
Firstly what IK Method are you using? Seems like manual trigonometric calculations.
Secondly:
So about this did you make sure the clamp your trigonometric functions? The scenario where it freaks out is yes a rounding error I’ve had it happen before. Did you make sure to add a math.clamp?
-- Obtains the CFrame rotation calculation for CFrame.fromAxis
local limbVectorRelativeToOriginal = previousLimbCF:VectorToWorldSpace(originalVectorLimb)
local dotProductAngle = limbVectorRelativeToOriginal.Unit:Dot(currentVectorLimb.Unit)
local safetyClamp = math.clamp(dotProductAngle, -1, 1)
local limbRotationAngle = math.acos(safetyClamp)
local limbRotationAxis = limbVectorRelativeToOriginal:Cross(currentVectorLimb) -- obtain the rotation axis
I have a high suspicion one value went NAN and ruined everything like in your second gif. This has happened to mine as well with limbs disappearing as well.
Currently for performing constraints, the IK I’m stumped as well. There just seems to be a region where the IK can’t solve and will freak out when the end effector is in that area. The solution for mine was to just remove the constraints when it goes outside a predefined area which I defined using region 3 parts. It’s merely a bandaid solution and I don’t like it at all.
Hopefully, we can work out a way to resolve these odd IK glitches.
Currently, I’m using FABRIK to do IK, I have no idea if you want to try it out but here is the link anyway since I open-sourced mine.