# [SOLVED] trigger every 10th frame

## Recommended Posts

hey guys.

simple question which I do not hold the answer to.

I have a switch and I want it to switch input number every 50th frame going between 0 and 1.

so example would be that for the first 50 frames the active switch value is 0 and then on frame 51 it goes to 1, hold that for 50 frames and then turns back to 0.

I need this to be a procedural expression if possible rather than key framing it.

Thanks

Edited by Jesper Rahlff

##### Share on other sites

this expression does it (floor((\$F+50)/50)%50)%2

but I'm sure there is an easier one. I even remember a thread here on odforce where I posted the solution but it was a long time ago and I can't find it anymore..

EDIT: found it! In your case it would be \$F%100<50

So we can say that if you need to turn something on (= 1) every n frames for a certain duration (num_frames_turned_on)
the general form is \$F % ( every_n_frames + num_frames_turned_on ) < num_frames_turned_on

Edited by 3dome
found it!
• 2
• 1

##### Share on other sites

just messing around, also found this to work:

floor(fit(\$F % 101,0,101,0,2))

##### Share on other sites

fantastic man. Thanks for the nice explanation.

## Create an account

Register a new account