How to check if a value is a multiple of another value (solved)

How do I…

Check if a number is a multiple of another value, for example, check if the object’s x position is a multiple of 32


Im fooling with procedural level generation, and i need the pathfinding object, the one that draws terrain, to spawn a platform object.


Also, why is this happening?
with only this?

I can’t imagine why they’re spinning. Do you have more events or behaviors?

For multiples, you can use the mod(#,#) expression. Inside a compare 2 numbers condition. mod(#,#) returns the remainder of the 1st number divided by the 2nd number. If the first number is less than the 2nd it returns the first. So, if the there is no remainder it’s either zero or a number divisible by the 2nd number

[Compare 2 numbers condition]
mod(objectName.X(),32) equals 0

If you don’t want zero you can add objectName X ≠ 0 condition.

1 Like

Ah, thank you, I will try that, also, I do have some more extension installed, however the only one attached is the basic platform behavior. I have similar objects that don’t spin however. Also, those are the only scene events

lol, they had the top down behavior and I didn’t notice! :rofl:

1 Like