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

Doesn't work, should be easy?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
d.CFrame = Torso.CFrame * CFrame.new(Vector3.new(0, 0.5, -2)) * CFrame.fromEulerAnglesXYZ(Torso.CFrame.lookVector)

12:05:00.422 - Players.Player.PlayerGui.Moves:169: bad argument #3 to 'fromEulerAnglesXYZ' (number expected, got no value)

1 answer

Log in to vote
0
Answered by 8 years ago

The problem is that CFrame.fromEulerAnglesXYZ must be given 3 numbers, but you're giving it a Vector3. To solve the problem:

d.CFrame = Torso.CFrame * CFrame.new(Vector3.new(0, 0.5, -2)) * CFrame.fromEulerAnglesXYZ(Torso.CFrame.lookVector.X, Torso.CFrame.lookVector.Y, Torso.CFrame.lookVector.Z)
Ad

Answer this question