Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions 33% chance of wiggle

  • 33% chance of wiggle

    Posted by Seth Olson on June 21, 2016 at 3:57 pm

    My goal is to have a wiggle, but inconsistently, so it has more of a stop motion feeling.

    I tried this on a position value, hoping to get a 33% chance of wiggle: (see code example)

    But the error I get says :
    Error at line 0 in property ‘Position’ of layer 9 (‘backEar’) in comp ‘bunny’. Object of type lLayer found where a Number, Array or Property is needed. An expression was disabled as a result of an error.

    Ideas?
    Thanks!

    if (random(0,1)>.66){
    wiggle(1,10)}

    Seth Olson replied 9 years, 10 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    June 21, 2016 at 4:15 pm

    You didn’t tell it what to do the other 67% of the time. Try this:


    if (random(0,1)>.66){
    wiggle(1,10);
    }else{
    value;
    }

    Dan

  • Joe Clay

    June 21, 2016 at 4:15 pm

    You were almost there. You just forgot to tell it what values to use when the condition wasn’t true. I put ‘value’ here so that it picks the values you have set (the value it would be without wiggle).

    if (random(0,1)>.66)
    {
    wiggle(1,10)
    }
    else
    {
    value;
    }

    Joe Clay
    Workbench.tv

  • Joe Clay

    June 21, 2016 at 4:16 pm

    Haha, you beat me to it Dan. Almost gave the same info as Dan. I feel good about myself. 🙂

    Joe Clay
    Workbench.tv

  • Seth Olson

    June 21, 2016 at 4:32 pm

    love it! you guys are the best.

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