How to set a part's orientation (to 0, 0, 0) using CFrame.Angles

I’d like to set the orientation of a model to 0, 0, 0.
Would really appreciate some help, I’ve tried multiple methods but I can’t seem to understand the CFrame api well enough.

Here’s something I tried, thought I could “subtract” the angles but its just reversing it :man_facepalming:

local primarypart_cf = model:GetPrimaryPartCFrame()
local x, y, z = (primarypart_cf - primarypart_cf.p):ToEulerAnglesYXZ()
local reverse_angles = CFrame.Angles(-x, -y, -z)

model:SetPrimaryPartCFrame(primarypart_cf  * reverse_angles)

Oriented part:
image

Expected result:
image

Actual result:

3 Likes

i dont know try this

local cframe = put something here

local newCFrame = CFrame.new(cframe.Position)

model:SetPrimaryPartCFrame(newCFrame)
2 Likes

NO WAY AHAHA

i thought not providing a cframe.angles would default to * cframe.angles(0,0,0)
welp, back to pre-school i go

THANKS A LOT.

1 Like