Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Having trouble with CFrame.fromEulerAnglesXYZ()?

I am working on a building game, but I am having trouble with one specific error involving CFrames. The purpose of the script is to rotate the model. Any help would be greatly appreciated

This is my script:

model:SetPrimaryPartCFrame(
	mod:GetPrimaryPartCFrame() + CFrame.fromEulerAnglesXYZ(Vector3.new(math.rad(90), 0, 0))
)

Error:

Argument 3 missing or nil

I genuinely have no idea what the 3rd argument is.

1 answer

✓ Accepted answer

fromEulerAngles takes three numbers as parameters, not one vector3 value.

model:SetPrimaryPartCFrame(
    CFrame.fromEulerAnglesXYZ(math.rad(90),0,0) * mod:GetPrimaryPartCFrame()
)

4 comments

1

Also, you can't add CFrames. To apply this rotation you'll want to multiply it (*) instead

0

Thanks for the reminder, I updated the code.

1

Thanks

0

Thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.