Quantcast
Channel: Answers for "Is there a modulus operator in Unity JavaScript?"
Browsing latest articles
Browse All 8 View Live

Answer by spinaljack

Yes,if(Time.frameCount%10 == 0)returns true every 10 frames

View Article


Answer by photon

If you are looking for a math function though, just use Javascripts %-operator.Meaning, if you want to calculate number mod 2 use number%2 The value of this operation is the division remainder (9%2 = 1)

View Article


Answer by Dansl

You can. Just Do (a = a % b) because (a %= b) does not work...

View Article

Answer by InoGamalinda

The % operator is the Remainder operator Example: > -3 % 3 -> 0>> -2 % 3 -> -2>> -1 % 3 -> -1 >> 0 % 3 -> 0 >> 1 % 3 -> 1>> 2 % 3 -> 2>> 3 % 3...

View Article
Browsing latest articles
Browse All 8 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>