How to make particles flicker?

   424   3   1
User Avatar
Member
3 posts
Joined: March 2024
Offline
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:


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.
User Avatar
Member
7772 posts
Joined: Sept. 2011
Online
the stratified ages will mean that frameAge%5 will almost never equal 0. Maybe you meant to round it to the nearest frame first?
User Avatar
Member
394 posts
Joined: Nov. 2016
Online
I suspect what you're looking for is something like this:
ramp = fit((@age * 24) % 5, 0, 5, 0, 1);
User Avatar
Member
3 posts
Joined: March 2024
Offline
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.
  • Quick Links