How do I round an object’s rotation to the nearest 90?

I’m trying to make a square jump, and it rotates when it’s in the air
…but I don’t know how to make it round to the nearest 90th degree, how do I do that?

11 Likes

((Round(rotation ÷ 90))×90) snaps to 90° intervals.

10 Likes

How the above works


let rotation = 89

89 ÷ 90 = 0.98888

round(0.98888) = 1

1 × 90 = 90


let rotation = 196

196 ÷ 90 = 2.17777

round(2.17777) = 2

2 × 90 = 180


11 Likes

Can the leads close this now?

7 Likes

This topic was automatically closed after 2 days. New replies are no longer allowed.