So ive been trying to do some procedural animation with the ik controls roblox provides for the past couple of weeks and im trying to use hinge constraints for the correct leg bending, but ive ran into a problem…
To start off my ik controls are set up like this.
I also have hinge constraints to limit the bending it can do but for some reason the hinges dont work on the client view??? They seem to only work on the server for some odd reason, and when they do work on the client they glitch out, heres a few pictures of what i mean.
Server view:
Client view:
The target attachment for the ik is the same in both the client and the server but only the server seems to react while the client doesnt.
Is there some other property im missing?
And yes i did not forget to enable IkControlConstraintSupport in the workspace.
Heres the code im using, its all on a server script. If im missing something of importance please tell me.
local character = script.Parent
task.wait(1)
local hum = character:WaitForChild("Humanoid")
--hum.HipHeight *= 0.75
local hrp = character:WaitForChild("HumanoidRootPart")
local H = character:WaitForChild("Head")
local UTOR = character:WaitForChild("UpperTorso")
local LTOR = character:WaitForChild("LowerTorso")
local RUL = character:WaitForChild("RightUpperLeg")
local RLL = character:WaitForChild("RightLowerLeg")
local RF = character:WaitForChild("RightFoot")
local LUL = character:WaitForChild("LeftUpperLeg")
local LLL = character:WaitForChild("LeftLowerLeg")
local LF = character:WaitForChild("LeftFoot")
local LUA = character:WaitForChild("LeftUpperArm")
local LLA = character:WaitForChild("LeftLowerArm")
local LHA = character:WaitForChild("LeftHand")
local RUA = character:WaitForChild("RightUpperArm")
local RLA = character:WaitForChild("RightLowerArm")
local RHA = character:WaitForChild("RightHand")
local function ADDCONSTRAINTS(one,two,name)
local attach0 = nil
local attach1 = nil
if one:FindFirstChild("Attachment") then
attach0 = one:FindFirstChild("Attachment")
attach1 = two:FindFirstChild("Attachment")
else
attach0 = Instance.new("Attachment")
attach0.Parent = one
attach1 = Instance.new("Attachment")
attach1.Parent = two
one.WorldCFrame = two.WorldCFrame
end
local rightKneeConstraint = Instance.new("HingeConstraint")
rightKneeConstraint.Parent = character.Humanoid
rightKneeConstraint.Name = name
rightKneeConstraint.LimitsEnabled = true
rightKneeConstraint.UpperAngle = 10
rightKneeConstraint.LowerAngle = -130
rightKneeConstraint.Attachment0 = attach0
rightKneeConstraint.Attachment1 = attach1
end
local one = RUL.RightKneeRigAttachment
local two = RLL.RightKneeRigAttachment
local three = LUL.LeftKneeRigAttachment
local four = LLL.LeftKneeRigAttachment
local ik = Instance.new("IKControl")
ik.Type = Enum.IKControlType.Position
ik.Target = game.Workspace.Terrain.Foot1
ik.ChainRoot = LUL
ik.EndEffector = LF
ik.Parent = hum
ADDCONSTRAINTS(one,two,"RightKneeConstraint")
ADDCONSTRAINTS(three,four,"LeftKneeConstraint")