Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would I "translate" this to the C0 property of a Motor6D?

Asked by 9 years ago

So I'm attempting to make a thing that makes the right arm of the player point towards the mouse. I have been successful in doing this, however, it is a pretty bad technique for doing so. I've learned that you could use the Motor6D Right Shoulder located in the characters torso for a smoother way of doing so (I've made the script based off of position). Does anyone know a way of doing so?

This is what I have so far:

function pointArms(t, a, p, c0, c1)
    local offset = (t.CFrame*CFrame.new(c0)).p -- find offset
    local dir = (mid - p).unit -- find direction 
    local rot = CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
    local rightangle = CFrame.fromEulerAnglesXYZ(0, 0, math.pi)
    local pos = CFrame.new(c1) -- position
    ra.CFrame = CFrame.new(offset, offset + dir) * rot * pos * rightAngle -- Changes position. However, the goal is to make this change the right shoulder in torso for a smoother effect.
end
0
does the argument a do anything in the function? is ra in line 7 a typo that should be a? aquathorn321 858 — 9y

Answer this question