Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random speed of objects

  • Random speed of objects

    Posted by Todd on January 30, 2007 at 12:08 am

    Hi I’ve searched but can’t seem to find a solution so I hope this isn’t redundant.

    I’m trying to do something really simple. I Just want to have objects move at random speeds in a straight line across the screen (x position).

    I program in Lingo (director) and it is very easy, I would just use something like this attached to each object:

    speed=random(50,100)
    sprite(5).locH = sprite(5).locH + speed

    Thats a very basic example of course. I just am wondering how to do the same thing in AE using expressions.

    IDeas?

    Todd replied 19 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 30, 2007 at 1:00 am

    This should get you started. It will move a layer horizontally across the screen at a random speed.

    seedRandom(index,true);
    spd = random(50,100); // speed (pixels per second)
    value + [spd*time,0]

    Dan

  • Todd

    January 30, 2007 at 1:46 am

    Dan thank you so much that is perfect.

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