Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Light Beams (Start at Random X axis point, hold that until 8 seconds when meeting at center, repeat from different x axis point)

  • Light Beams (Start at Random X axis point, hold that until 8 seconds when meeting at center, repeat from different x axis point)

    Posted by Kyle Balitz on November 2, 2018 at 7:36 am

    Hello I know nothing about Java script programming but trying to get into learning how to do expressions. What I want seems simple but hard to execute. I am trying to make light beams that shoot from a random X axis point meeting at the same center point, and hold that for 8 seconds (or any amount of seconds I give it), and shoot off from another random x axis point at the beginning as it repeats. The Y axis does not change. I am trying to make something like blurred motion high way of cars meeting at the same point in the distance.

    These were kinda the ideas I was starting with. I apologize if I am completely wrong, other wise the most simpler method would be to just duplicate my layers and just change the starting x axis point at a specific point I tell it to be. I am using the saber effects. I been toying with Random() and seed. Wiggle moves too fast. I also tried a slider null. Sorry I am just very confused about this, if it makes any sense.

    Note: If I leave everything as is with no expressions used, the effect just repeats as is within 8 seconds, shooting from the same point at the bottom as I put loop() in other parts of the saber effect. But I want it to shoot from different parts at the bottom of the screen, but hold that same line position until it disappears into the center point. Using wiggle and random just makes the line travel everywhere randomly too fast.

    Thank you.

    e = effect("Saber")("End Offset");
    if (e == 0) {
    [value[0] + random(300, 1200), value[1]];
    }
    else (e > 0) {
    [value[0], value[1]];
    }

    e = effect("Saber")("End Offset");
    r = random(284, 1000);
    if (e == 0) {
    [value[0] + r, value[1]];
    loopInDuration(type = "cycle", duration = 8);
    }

    if time>1{
    value[0]+random(200,1200), value[1];
    }
    else time<8
    value[0], value[1];
    }

    Kalleheikki Kannisto replied 7 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    November 4, 2018 at 9:18 am

    To get a new random value every 8 seconds, you can change the random seed every 8 seconds with Math.floor(time/8).

    Kalleheikki Kannisto
    Senior Graphic Designer

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy