[Math] Check variable every 10 values

Hi,

I’m struggling with probably pretty easy thing to do, however I’m out of ideas.

I’m trying to set up a condition for branch check for an integer to return every 10th value. Integer in my project is referencing “Targets Destroyed” amount and basically I want to set a condition with every 10th object being destroyed (every 10th integer value added). So basically I’d get true or false with 10 targets destroyed, 20 targets destroyed and so on.

Right now I’m just setting the condition to >= than i.e 5, but that let’s me to set bools just once (targets destroyed int keeps going up).

I wonder if it can be done in one function, or needs to be parsed to tick so the need value is being monitored all the time. Halp !

Cheers for the answers,

Cheers for the answer,

Just to let you know. I’ve already got those “Targets Destroyed” Int set up, once something dies it’s being added to variable. My problem here is how to do the math so I can perform an action/event based on true/false bools where I want to to be true with every 10 target destroyed and false if the int value is different than x*10.

You can do this by using the modulo operator. Every time something dies, call a function that adds one, checks if that value modulo 10 equals 0. If it does, set the boolean value to true.

That is why I said use the modulo operator and check that the result equals 0.