playMaker

Author Topic: "Is Int a Multiple of Another Int?"[SOLVED]  (Read 175 times)

westingtyler

  • Full Member
  • ***
  • Posts: 210
    • View Profile
    • My Oculus Rift + Touch VR Game Using Playmaker
"Is Int a Multiple of Another Int?"[SOLVED]
« on: October 08, 2018, 08:26:21 PM »
depending on a setting, i want a sound to play every time a loop count int is a multiple of a certain number, during a looping process. (sound on string typwriter-ing.)

Is (Current Loop Int) a Multiple of 5? YES/NO.

Is (Current Loop Int) a Multiple of 9? YES/NO.
« Last Edit: October 11, 2018, 01:43:24 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13611
  • Official Playmaker Support
    • View Profile
Re: "Is Int a Multiple of Another Int?"
« Reply #1 on: October 11, 2018, 01:43:09 AM »
Hi,

 for this, you need to check the modulus.

https://stackoverflow.com/questions/3216496/c-sharp-how-to-determine-if-a-number-is-a-multiple-of-another

Look for the IntModulo  custom action on the Ecosystem

Bye,

 Jean