-
Don’t run every frame
Hey guys,
I’m wondering if there’s a way to create a random position, but then hold that random position, from when an even triggers until it ends.
Essentially, my event is
a = effect("Advanced Lightning")("Core Radius");When a is not equal to 0, I’d like my script to calculate (and most importantly hold on to) a new position.
a = effect("Advanced Lightning")("Core Radius");if (a != 0) {
x = random(0, 3840);
y= random(0,768);
curPos = [x,y];
}However, the way this works is that for every frame a is not 0, I’m given a new random position.
Is there a way to trigger this the first time a changes from 0 to another value. I thought maybe a do/while would work, but that’s timing out AE’s engine.Any help would be appreciated. Thanks heaps!
Lead VFX and Motion Design at Tomorrowland NZ