I’m using an IKControl to make the player’s arm follow the mouse, but I can’t get it to work. The easy way to go about it would just be to set the target’s position to the mouse.hit.position, but the mouse.hit.position is so far away at times that the arm won’t fully point to it. To fix this, I’m setting the position to the mouse.hit.position, but then subtracting the right hand’s lookvector multiplied by the distance between the righthand and the mouse.hit.position. Through testing with dummies, I found out that making the part extremely close to the player will make the IKControl seem much more accurate. I’m trying to do this, but to no avail.
grappleStartIKTarget = Instance.new('Part', char)
grappleStartIKTarget.CFrame = CFrame.lookAt(mousepos, root.Position)
grappleStartIKTarget.CanCollide = false
grappleStartIKTarget.Anchored = true
grappleStartIKTarget.Transparency = 1
script.Direction.Value = grappleStartIKTarget.CFrame.LookVector
grappleStartIK = Instance.new('IKControl', hum)
grappleStartIK.ChainRoot = char:WaitForChild('RightUpperArm')
grappleStartIK.EndEffector = char.RightLowerArm
grappleStartIK.Target = grappleStartIKTarget
grappleStartIK.Type = Enum.IKControlType.Position
grappleStartIK.Weight = 0.5
grappleStartIK.Name = "grappleStartIK"
hb = game:GetService('RunService').RenderStepped:Connect(function()
if script.Parent.GrappleCam.Initial.Value then
local ikDistance = (char.RightHand.Position - mouse.Hit.Position).Magnitude
grappleStartIKTarget.CFrame = CFrame.lookAt((mouse.Hit.Position + (-char.RightHand.CFrame.LookVector * ikDistance)), root.Position)