How to make particles flicker?
687
3
1
Hey, I've been trying to make my particles flicker in VEX.
I tried to make it transparent every 5 frames.
This is the code I wrote inside the VEX code window of POPcolor's Alpha:
![](https://i.gyazo.com/58a311b11b5da4c4db6b8832c958e080.png)
And this is the result:
As you can see, the particles don't flicker. It goes straight to the "else" statement and never enters the "if".
I am quite new to Houdini.
-
- jsmack
- Member
![](https://static.sidefx.com/djangobb_forum/img/authority/vote10.png)
- 7981 posts
- Joined: Sept. 2011
- Offline
the stratified ages will mean that frameAge%5 will almost never equal 0. Maybe you meant to round it to the nearest frame first?
-
- Tanto
- Member
![](https://static.sidefx.com/djangobb_forum/img/authority/vote8.png)
- 442 posts
- Joined: Nov. 2016
- Offline
I suspect what you're looking for is something like this:
ramp = fit((@age * 24) % 5, 0, 5, 0, 1);
jsmack
the stratified ages will mean that frameAge%5 will almost never equal 0. Maybe you meant to round it to the nearest frame first?
Thanks so much! That is correct, I forgot to round the result.
Tanto
I suspect what you're looking for is something like this:
ramp = fit((@age * 24) % 5, 0, 5, 0, 1);
Thanks that works too.