Here's a Gyazo showing the issue https://gyazo.com/ecc3454237ddb81ba8f4a818bc4b6bd0

The reason for it is once the rotation of the camera reaches 179.9 it becomes -179.9 until it reaches 0

local sx, sy, sz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = game.Workspace.CurrentCamera.CoordinateFrame:components()
heading = math.atan2(m02, m22)
local heading = math.deg(heading)
ImageLabel.Rotation = heading

Here's what the ImageLabels rotation is bottom 0 right 90 top 179.999 left -90

Looking to the top and bottom are correct, it's only right and left that are inverted. How would I fix this?

5 comments

0

what the heck is math.atan2

0

@greatneil80 from the wiki "Returns the arc* tangent of y/x (in radians), but uses the signs of both parameters to find the quadrant of the result. It also handles correctly the case of x being zero." http://wiki.roblox.com/index.php?title=Global_namespace/Mathematical_functions#math.atan2

0

Try making the heading Negative to inverse its sign..

0

Use :inverse()

0

Yep that worked, thanks. If one of you wish to write it as a answer I'll mark this as solved.