...
Create an agent group and add a grid layout and a state machine modulecomponent.
Press on the randomize button net next to the state attribute until you activate the expression mode.
Now press the “open editor” button to open the expression editor.
Add the expression like in the picture below and press save.
...
If you press play, the agent switches its state to 1 when the frame is higher then 20.
...