If I'm not wrong you convert from radians to degrees this way:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local degree = player:get_look_yaw()*180/math.pi
This results in values 90° shifted to the debug-output.
So your next attempt will be:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local degree = player:get_look_yaw()*180/math.pi - 90
That results often in correct values. But sometimes in negative values, no not just by the 90°. They are really absurd.
Next try:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local degree = player:get_look_yaw()*180/math.pi - 90
if degree < 0 then degree = degree + 360 end
Aw, c'mon. You really have to do this?