Trying to set up a dynamic grip system for my game, where the player’s hands will automatically connect to the left and right grip attachments in the gun’s model (which is attached as an accessory)
I adapted this code from LMH_Hutch’s inverse kinematics guide…
local rightShoulderCFrame = Character["Right Arm"].CFrame * CFrame.new(1.5, 0.5, 0)
local rightGoalPosition = game.Workspace["Model 12"].Handle.GripRight.Position
local rightV3 = Vector3.new(0, 1, 0) * Character["Right Arm"].Size
local planeCF, rightShoulderAngle, rightElbowAngle = SolveIK(rightShoulderCFrame, rightGoalPosition, rightV3.Y, 0)
local rightShoulderAngleCFrame = CFrame.Angles(rightShoulderAngle, 0, 0)
local rightElbowAngleAngleCFrame = CFrame.Angles(rightElbowAngle, 0, 0)
Character["Right Arm"].CFrame = planeCF * rightShoulderAngleCFrame * CFrame.new(-rightV3 * 0.5)
…but it seems like the arm drags the entire rest of my character’s body with it and won’t move independently, even when targeting an object not attached to my character. I don’t really understand IK very well to begin with, so I’m wondering if there’s a simpler solution I’m not seeing.