FORUMS: list search recent posts

33% chance of wiggle

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Seth Olson
33% chance of wiggle
on Jun 21, 2016 at 3:57:15 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)}


Return to posts index

Dan Ebberts
Re: 33% chance of wiggle
on Jun 21, 2016 at 4:15:06 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



Return to posts index

Joe Clay
Re: 33% chance of wiggle
on Jun 21, 2016 at 4:16:02 pm

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

Joe Clay
Workbench.tv


Return to posts index


Joe Clay
Re: 33% chance of wiggle
on Jun 21, 2016 at 4:15:10 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


Return to posts index

Seth Olson
Re: 33% chance of wiggle
on Jun 21, 2016 at 4:32:39 pm

love it! you guys are the best.



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]