[SOLVED] How to flip value between 0 and for example 100 with one formula

Solution By MrMen
value = mod(value + 100, 200)
So like

Change Variable set to mod(Variable+your value, your value * 2)

I am sure i did it once i just forgot how

For example i have variable and i want it to flip between 0 and 100
So like ping pong 0 100 0 100 0 100
I am more than sure i did it with only one formula
But did not write it down
And i don’t remember how
mod(value +100 , 100) leaves it at 0

You mean - just one expression? I can’t see how you toggle it without an if statement other than possibly an expression using cos and Time Delta?

Formula not expression

And yes you can i did it i just don’t remember how
Same way you use this

StrRepeat("OFF",abs(SettingsSave.FullScreen-1))+StrRepeat("ON",SettingsSave.FullScreen)

To make boolean display on off instead of true false or 0 1

Anyway it was combination of expressions i believe and some math making that whole formula
But i simply cannot remember how to do it

Close. It’s value = mod(value + 100, 200)

3 Likes

Im old
Memory not good anymore

And yeah exactly that THX

Oooh! Sorry to hear this.