Rotation of CFrame not working as expected

You can write your topic however you want, but you need to answer these questions:

  1. **What do you want to achieve?**I want a simple placement system which i already create to support rotation which I just create an event and a variable called Angles,Then when you pressed a button,That’ll increase by 45,Then i plug that variable into a cframe.angle which multiply a cframe.new(furniture.Pos)

  2. What is the issue? It’ll rotate,But at the wrong step,when i press the button 2 time it’ll rotate more or less than 90 degree,When I press another button which will decrease the angles,For example i press the first button 2 time,Ill have to press the second button 2 time to maker it goes to the original rotation

  3. **What solutions have you tried so far?**Ive tried using radian instead.By setting the rotation in cframe in the rotation vector 3 of the cframe.new,But the more i press the button,The less itll rotate,In the radian option,I rotate by math.pi*rotation/4,in which rotation is increment by 1

Radian version
cf = CFrame.new(pos,Vector3.new(0,rotation/4*math.pi,0))
Angle version
cf = CFrame.new(pos)*CFrame.Angles(0,rotation,0)

the radian version was doing CFrame.LookAt

proper:
cf = CFrame.new(pos)*CFrame.Angles(0,math.rad(rotation),0)

2 Likes