im trying to get the players right arm to point towards their cursor position but i cant seem to figure out the CFrame maths to do so.
(i know i probably shouldnt use Mouse.Hit, i am only doing this for testing as i am trying to get it working before writing it properly)
what i have tried so far:
local jointPosition = Shoulder.Part0.CFrame:toWorldSpace(CFrame.new(0.9,0.25,0.25))
local cframe = CFrame.new(jointPosition.p, Mouse.Hit.Position) * CFrame.Angles(math.pi/2, 0, 0) * CFrame.new(0, -1, 0)
Shoulder.C0 = Shoulder.Part0.CFrame:ToObjectSpace(cframe)
local Transform: CFrame = Shoulder.Transform
Shoulder.Transform = Transform:Lerp(CFrame.lookAt(Shoulder.Part0.CFrame.Position,Mouse.Hit.Position).Rotation * CFrame.Angles(math.rad(90),0,0),.1)
yea could you send the entire script, im not sure if “shoulder” is a variable or if u made like an attatchment or idk, but i dont have enough reference to go off of with just this
The Shoulder is just the Right Shoulder Motor6D that is inside of the players Torso.
also this is running in RunService.PreSimulation incase you wanted to know
ohh i see what your trying to do then, so i think when you change the cframe of a part thats attatched by a motor6d then it destroys the motor6d, so instead try doing C0, instead of Part0 just try rq
and make sure not to do C0.Cframe because C0 is already a cframe value, so just change it to that