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

Unable to cast Vector3 to CoordinateFrame?

This is the script

local RotatedCFrame = (model.MainPart.Position) * math.rad(0, -90, 0) 
model:SetPrimaryPartCFrame(RotatedCFrame)

1 answer

✓ Accepted answer

SetPrimaryPartCFrame uses CFrame and in this case, you are setting it to a Vector3 value. To fix this, you must change:

local RotatedCFrame = (model.MainPart.Position) * math.rad(0, -90, 0)

to a CFrame value like this:

local RotatedCFrame = (model.MainPart.CFrame) * CFrame.Angles(math.rad(0), math.rad(-90), math.rad(0))

2 comments

0

it stays at the same orientation

0

Never mind I figured out I only typed what you wrote

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