I’ve created an inverse kinematics system to control the characters arm. The system outputs a CFrame for the upper and lower arm which is correct, but applying the appropriate changes to the Shoulder and Elbow joint motors in the character doesn’t work, as the default character animations still cause the arms to move around. The motors C1 property is set as so every frame:
ShoulderJoint.C1 = UpperArmCFrame:Inverse()*ShoulderJoint.Part0.CFrame*ShoulderJoint.C0 ElbowJoint.C1 = LowerArmCFrame:Inverse()*ElbowJoint.Part0.CFrame*ElbowJoint.C0
Where UpperArmCFrame and LowerArmCFrame are the desired world cframes of the respective arm parts. This code works fine if it’s being applied to a motor not being controlled by animations.
The grey blocks are parts that are set to the output CFrame of the inverse kinematics system, they represent what the players arm should be doing. However it can be seen that while the players arm vaguely follows where it should be, the character animations still seem to be affecting it. I have tried using .RenderStepped, .Stepped, and :BindToRenderStepped at various priorities. Blanking both the C0 and C1 of the motor each frame does not fix this problem, and the arm will still wave around, just beginning from the middle of the torso instead.
I don’t want to delete the joints and just set the CFrame directly as I may still need to use regular animations at times.
EDIT: I also tried setting Transform to a blank CFrame, but that made no difference. Here’s what happens if you pull out all the IK code and just replace it with this:
ShoulderJoint.C1 = CFrame.new() ElbowJoint.C1 = CFrame.new() ShoulderJoint.C0 = CFrame.new() ElbowJoint.C0 = CFrame.new() ElbowJoint.Transform = CFrame.new() ShoulderJoint.Transform = CFrame.new()
Notice the arm is still animated, even though all the CFrames of the motors and being blanked every frame