Hi
I used VAR Toggle to choose between 2 backgrounds.
But I have 5.
Is it possible to cycle through them with VAR Increment?
Is possible to do that with the hands etc too, so that I kinda have 5 different faces to pick.
If yes, how?
Bye
Nico
Hi
I used VAR Toggle to choose between 2 backgrounds.
But I have 5.
Is it possible to cycle through them with VAR Increment?
Is possible to do that with the hands etc too, so that I kinda have 5 different faces to pick.
If yes, how?
Bye
Nico
Yes! You can use the modulo expression %
to do that.
If you only have 5 faces total, and you’re using VAR_1, then each face’s opacity can be set in the manner below, to either show it or to hide it. You will need to increment VAR_1 and keep incrementing (in your face above you’re toggling it).
$(#VAR_1#%5)==0?100:0$
$(#VAR_1#%5)==1?100:0$
$(#VAR_1#%5)==2?100:0$
$(#VAR_1#%5)==3?100:0$
$(#VAR_1#%5)==4?100:0$
Continuing to increment VAR_1 will keep it counting up, but using the modulo expression as above, its result will keep cycling from 0 to 4 over and over. If you had more faces, then the modulo calculation would be (#VAR_1#%X)
where X is the total number of faces, and the equality test would be from 0 to X-1.
Now, another way is to set each face’s X location, to either have it in the middle of the face at 160 or to hide it by moving it off the face at -200 in this manner:
$(#VAR_1#%5)==0?160:-200$
$(#VAR_1#%5)==1?160:-200$
$(#VAR_1#%5)==2?160:-200$
$(#VAR_1#%5)==3?160:-200$
$(#VAR_1#%5)==4?160:-200$
If you’re doing something else with an element’s opacity, then the second method is obviously the way to go.
Play with modulo in an Excel spreadsheet to see it visually. Here’s a snapshot of using modulo with 4 different values of 2, 3, 4, and 5. You can see how it controls the cycles:
Thanks so much! It works fine.
We keep on learning.
Looks like we have a Mind Reader. I was thinking of a face that change for another every srcond. Might have it done by Christmas.