I am trying of rotate the player with a key in 0, 90, 180 in a 3d game, depending of the direction, but not work well.
if Input.is_key_pressed(KEY_M):
if rotation_degrees.y>0 and rotation_degrees.y<90:
rotation_degrees.y=0
if rotation_degrees.y>90 and rotation_degrees.y<180:
rotation_degrees.y=90
if rotation_degrees.y>-180 and rotation_degrees.y<-90:
rotation_degrees.y=-90
if rotation_degrees.y>-1 and rotation_degrees.y>-90:
rotation_degrees.y=0