#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)
i think it would be {object}.CFrame = {object}.CFrame * CFrame.new(1,0,1)
alr thanks
That translates the CFrame's position 1 stud right & 1 stud back, you need to multiply using CFrame.Angles()
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
oops
i knew i was forgetting something lol
wouldnt it be * CFrame.Angles(1,0,1) still?
thanks
Nope, then that would be translating (changing by) the CFrame's angle by 1 radian on the X axis & 1 radian on the Z axis
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