Hey! So recently I've been trying to figure out how I can aim an R6 rig's arms to a location.
So here's what I did so far:
I made a new part to be the shoulder joint for the right arm, welded that part to the right arm, then offset it's CFrame so it's in the position of the shoulder.
Then, I created a part to be the fake right arm. I welded that arm to the shoulder joint I just made, and then I would adjust the fake arm's weld CFrame utilizing CFrame.Angles to point it at a location.
I tested this method, using the code shown below in a loop:
w2.C0 = w2.C0 * CFrame.Angles(math.rad(1),math.rad(1),0)
And everything I did worked! The fake arm rotated around the shoulder joint correctly.
However, everything started going downhill when I changed the code to this:
w2.C0 = CFrame.new(w2.C0,game.Workspace.Point_To_This_Brick.CFrame.p)
The arm didn't point on-key, it was horrific.. I can't figure out why this code isn't working correctly. But I did make an assumption, on how to get this code working, in which I'm unable to solve it...basically to do some kind of operation to find the angle between the arm/shoulder joint, to the location brick, and then use that information in CFrame.Angles.
I'm really not that good with mathematics.. any help on the subject would be highly appreciated. Thanks guys!
