What's Roblox's orientation formula?

So we all know what’s orientation, but there’s something that I need to know.

When you try to set/change a part’s orientation if the given value (Doesn’t matter on which axis) is bigger than 180, the studio will automatically convert that value to a number between -180 and 180.

for example:
let’s say that I want to change a part’s orientation and if I try to set an axis’s value to 7000 the studio will convert that to 160 like this:

Screenshot (4)

Screenshot (5)

my question is what’s that formula? how we can calculate this?

You can easily do this my getting the modulus of the inputted number like this:

print(7000%360) --You can change 7000 with any number you like.
--Output
->160
1 Like

Thank you so much, I’ve been struggling with this for hours :sweat_smile:
just one more question, what does % mean in Lua in here?

1 Like

You can check out all the math operators in Lua, including %, here: Operators | Documentation - Roblox Creator Hub

1 Like

It means the modulus operator.

1 Like