Cframe script not working as it is supposed to

Hi this cframe script is supposed to rotate the part to 45degrees but its restting the postion to (0,0,0).Can anyone help me with this?

THE SCRIPT

local Part = script.Parent

Part.CFrame = CFrame.Angles(0,math.rad(45),0)

Part.CFrame = Part.CFrame * CFrame.Angles(0,math.rad(45),0)

Part.CFrame = CFrame.Angles(0,math.rad(45),0)

Try removing this part, since CFrame is both a position and an orientation and you’ve only given an orientation, the position defaults to (0,0,0)

if i remove this part will it still work?

Yes, it will still work.

local Part = script.Parent

Part.CFrame = Part.CFrame * CFrame.Angles(0,math.rad(45),0)

Yes it did work thanks a lot for helping me that meant a lot

1 Like