So i have a free building system that works very well, though when i tilt the part im building by pressing F, it rotates fine, but when I press E, it rotates in a different direction instead of the normal rotation when the part is face up.
My current code: All variables are defined correctly.
fakebox.CFrame = CFrame.new(X,Y,Z)*CFrame.Angles(math.rad(rot3),math.rad(rot),math.rad(rot2))
if inp.KeyCode == Enum.KeyCode.Q then
rot = rot + 90
if rot == 360 then
rot = 0
end
script.Parent.Rotate:Play()
end
if inp.KeyCode == Enum.KeyCode.E then
rot = rot - 90
if rot == 0 then
rot = 360
end
script.Parent.Rotate:Play()
end
if inp.KeyCode == Enum.KeyCode.R and can3axis then
rot2 = rot2 + 90
if rot2 == 360 then
rot2 = 0
end
script.Parent.Rotate:Play()
end
if inp.KeyCode == Enum.KeyCode.F and can3axis then
rot2 = rot2 - 90
if rot2 == 0 then
rot2 = 360
end
script.Parent.Rotate:Play()
end
if inp.KeyCode == Enum.KeyCode.T and can3axis then
rot3 = rot3 + 90
if rot3 == 360 then
rot3 = 0
end
script.Parent.Rotate:Play()
end
if inp.KeyCode == Enum.KeyCode.G and can3axis then
rot3 = rot3 - 90
if rot3 == 0 then
rot3 = 360
end
script.Parent.Rotate:Play()
end
Thanks for the help!
