Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Wiggle position along a path

  • Pierre-alexis Tremblay

    October 2, 2013 at 3:49 pm

    Just as a precison I want the object to move randomly along a path, not add a simple wiggle expression to a motion path.

    P.A.T.

  • François Leroy

    October 2, 2013 at 4:13 pm

    Hi!

    You can try with this expression:

    François

    t = key(numKeys).time;
    valueAtTime(random(t));

  • Pierre-alexis Tremblay

    October 2, 2013 at 4:55 pm

    Thank you François.
    It works but it would be even better if the movement could be smoother, if position along the path could be controlled with a wiggle expression.

    P.A.T.

  • François Leroy

    October 2, 2013 at 5:06 pm

    Then, you can try with this:

    and you can set the frequency, just like a wiggle.

    Cheers,
    François

    frequency = 2;

    seed = Math.floor(time*frequency);
    start = seed/frequency;
    stop = start + (1/frequency);

    t = key(numKeys).time;
    seedRandom(seed,true);
    rand1 = random(t);
    seedRandom(seed+1,true);
    rand2 = random(t);
    easing = ease(time,start,stop, rand1, rand2);
    valueAtTime(easing);

  • Dan Ebberts

    October 2, 2013 at 5:10 pm

    Try this:

    freq = 1;
    t = key(numKeys).time;
    w = transform.rotation.wiggle(freq,100)-transform.rotation;
    newT = linear(w,-100,100,0,t);
    valueAtTime(newT)

    Dan

  • Pierre-alexis Tremblay

    October 2, 2013 at 6:23 pm

    Thanks guys both solutions are great.
    The only other thing to make this totally perfect would be control over random seed.
    Cheers.

    P.A.T.

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