How can I get a number in degrees from 0-360 reflecting the character's looking direction?

Hi, so for a compass I’m making, I need to figure out a way I can get a number from 0-360 that’s aligned with the rotation of the character. When I tried this previously, it did work, but after every like 90 degrees it went back to 0…

Any ideas? Thanks.

1 Like

Try getting the HumanoidRootPart’s rotation. I think it’s the Y axis that you want to read from.

1 Like
local look = character.HumanoidRootPart.CFrame.LookVector
local angle = math.atan2(look.X, look.Z)
print(math.deg(angle) % 360)
3 Likes