Try to decrease Flux with time

0 like 0 dislike

Hello, I'm trying to decrease the flux with time for my effect. I created an attribute for the duration of the effect :

 Flux = saturate((Duration-scene.Time)/Duration);

It's working on Popcorn, not in our engine. Because when it's finish, even with a restart I see nothing So my question is :  when we use Terminate function (like in unity), Flux is restart ? Maybe it's our fault, but when we restart our effect with this function, we see nothing, like the Flux is still at zero. Or maybe threre is another way to make this.

asked Aug 31 by Justine (160 points)

1 Answer

2 like 0 dislike
Best answer

You can try:

Flux = saturate((Duration-Age)/Duration);

scene.Time is the time since your Scene/Level has been loaded. In PopcornFX Editor, Ctrl-R (the nuke button) resets scene.Time to 0, but in Unity or UE, scene.Time continues incrementing independently of you restarting the effect.

Age in the Layer Script is the age of the spawner, the time since you spawned the effect:

answered Aug 31 by Jordan (12,810 points)
Thanks Jordan, now it's working ! :)