Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random position

  • Posted by Will Barry on June 19, 2007 at 7:39 am

    Hi there,
    Really new to expressions, so bear with me… I am trying to have some objects in a 3D scene move randomly. Here’s what I want to do:

    -the objects in the scene to start moving at the start (0sec) of the comp at a random speed in either -x or +x.

    -the speed to only be random up to a maximum value (so they move nice and slowly)

    -I don’t want them to change direction or speed at all, just move at a constant speed in a constant direction the whole clip (1:20) once they’ve ‘decided’ which way and how fast to go.

    I had a go with one of the programmers here helping me. He has done stuff in javascript and we used Dan Ebberts’ excellent site as a starting point, but we’re both stumped. (noobs!)

    Here’s the project file
    http://www.roarfilm.com.au/dev/search_previs.aep.zip
    The null object in the scene (that the rest are parented to) is basically the maximum speed at which I’d like the boxes to move, the ones going crazy are the ones we’ve tried to script.

    Any help would be much appreciated!

    Ganer Stewart replied 18 years, 10 months ago 3 Members · 4 Replies
  • 4 Replies
  • Lord Scales

    June 19, 2007 at 9:58 am

    Maybe this can help (for a 2D layer):

    w = wiggle (1, 200) //first value is frequency, second value is amplitude
    [w[0], value[1]]

    But if you read this: https://www.motionscript.com/mastering-expressions/random-1.html you are done so.
    I’d like to help more, but now I am without time…

  • Lord Scales

    June 19, 2007 at 10:05 am

    [WillB_82] “-the objects in the scene to start moving at the start (0sec) of the comp at a random speed in either -x or +x.

    -the speed to only be random up to a maximum value (so they move nice and slowly)

    -I don’t want them to change direction or speed at all, just move at a constant speed in a constant direction the whole clip (1:20) once they’ve ‘decided’ which way and how fast to go.”

    Hehe, I think a simple
    w = wiggle (1, 200) //first value is frequency, second value is amplitude
    [w[0], value[1]]
    won’t help you much.

  • Lord Scales

    June 19, 2007 at 10:05 am

    [WillB_82] “-the objects in the scene to start moving at the start (0sec) of the comp at a random speed in either -x or +x.

    -the speed to only be random up to a maximum value (so they move nice and slowly)

    -I don’t want them to change direction or speed at all, just move at a constant speed in a constant direction the whole clip (1:20) once they’ve ‘decided’ which way and how fast to go.”

    Hehe, I think a simple
    w = wiggle (1, 200) //first value is frequency, second value is amplitude
    [w[0], value[1]]
    won’t help you much.

  • Ganer Stewart

    June 19, 2007 at 2:59 pm

    apply your wiggle expression to the anchor point position. or

    gaussRandom(//min//[x,y,z], //max//[x,y,z])//this will return a mostly median position//

    AND

    to the object layer:

    You can add “Effect” “Expression Control” “Slider Control” and key frame it to adjust the amount and/or turn expression off and on.

    don’t know if this is much help.

    gs

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