#how would i reset the rotation of cframe making it NOT look above or below (so .Y if im not mistaken

14 messages · Page 1 of 1 (latest)

worthy flower
#

how would i reset the rotation of cframe making it NOT look above or below (so .Y if im not mistaken)

#

currently i do not want my cframe to be facing up or above, only plain x and z

twilit lintel
#

i think it would be {object}.CFrame = {object}.CFrame * CFrame.new(1,0,1)

twilit lintel
#

lmk if it works

#

im not entirely sure

autumn tartan
autumn tartan
# worthy flower currently i do not want my cframe to be facing up or above, only plain x and z

If you want to reset the rotation of any CFrame without changing position, you can input the CFrame's position into a blank/fresh CFrame (zero orientation by default)

local Object = Instance.new("Part")

-- Initial CFrame
-- Position at (0, 7, 12), facing directly upwards
Object.CFrame = CFrame.new(0, 7, 12) * CFrame.Angles(math.rad(90), 0, 0)

-- Reset Object's rotation
-- Position at (0, 7, 12), with the default orientation (zero on all axes)
Object.CFrame = CFrame.new(Object.CFrame.Position)
Object.CFrame = CFrame.new(Object.Position) -- Same thing
twilit lintel
#

i knew i was forgetting something lol

twilit lintel
autumn tartan
#

Multiplying a CFrame by another CFrame will just translate the 1st mentioned CFrame by the 2nd mentioned CFrame.
The order that you multiply CFrames matters a lot, and will change the outcome (depending on what they were) if you swap their order