I want to make the players who join the game's arms reach out for the cube in front of them, but there is no cube and nothing is reaching out. This script is in StarterCharacterScripts. Nothing is happening. I can do it manually by putting the IKconstraints into the humanoidrootpart, but I can't get the script to do it automatically. I think im very stupid. Second pic is what happens when I join the game
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local IKControl1 = ReplicatedStorage:FindFirstChild("IKControlLeftArm")
local IKControl2 = ReplicatedStorage:FindFirstChild("IKControlRightArm")
local humanoid = workspace:FindFirstChildOfClass("Humanoid")
local target = Instance.new("Part")
target.Name = "IKTarget"
target.Size = Vector3.new(0.3, 0.3, 0.3)
target.Anchored = true
target.CanCollide = false
target.Transparency = 0
target.Parent = workspace
local ik1 = ReplicatedStorage:FindFirstChild("IKControlLeftArm")
ik1.Parent = humanoid
ik1.Name = "LeftArm"
ik1.Type = Enum.IKControlType.Position
ik1.EndEffector = "LeftHand"
ik1.ChainRoot = "LeftUpperArm"
ik1.Target = game.Workspace.target
ik1.Priority = Enum.IKControlPriority.Automation
ik1.Weight = 1
local ik2 = IKControl2
ik2.Parent = humanoid
ik2.Name = "RightArm"
ik2.Type = Enum.IKControlType.Position
ik2.EndEffector = "RightHand"
ik2.ChainRoot = "RightUpperArm"
ik2.Target = game.Workspace.target
ik2.Priority = Enum.IKControlPriority.Automation
ik2.Weight = 1
if humanoid then
-- Example: Clone and parent IKControls to the Humanoid
if IKControl1 then
local ik1 = IKControl1:Clone()
ik1.Parent = humanoid
end
if IKControl2 then
local ik2 = IKControl2:Clone()
ik2.Parent = humanoid
end
end