Highlighted

How to animate random property every x seconds with an interval(hold) duration?

Community Beginner ,
Aug 07, 2020

Copy link to clipboard

Copied

Trying to animate y position at random, whereas the position change every second but the animation from the current y to the next takes half second. So the y stays put for 0.5 sec in between.

ex:
- animate y from 12 to 44 during 0.5 sec;
- stay at 44 for 0.5 sec;
- animate from 44 to x during 0.5 sec;
- etc

Similar to wiggle but adding an interval between each cycle.

Tried using seedRandom and posterizeTime but it will just snap from value to value, and I'd like it to ease in out and stop for a while. Does that make sense?

Thanks in advance.

Something like this maybe:

 

segDur = 1;
minVal = 0;
maxVal = 100;
seg = Math.floor(time/segDur);
seedRandom(seg,true);
curVal = random(minVal,maxVal)
seedRandom(seg-1,true);
prevVal = random(minVal,maxVal);
t = time%segDur;
ease(t,0,segDur/2,prevVal,curVal)

 

 

Dan

Topics

Expressions, How to, Scripting

Views

41

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to animate random property every x seconds with an interval(hold) duration?

Community Beginner ,
Aug 07, 2020

Copy link to clipboard

Copied

Trying to animate y position at random, whereas the position change every second but the animation from the current y to the next takes half second. So the y stays put for 0.5 sec in between.

ex:
- animate y from 12 to 44 during 0.5 sec;
- stay at 44 for 0.5 sec;
- animate from 44 to x during 0.5 sec;
- etc

Similar to wiggle but adding an interval between each cycle.

Tried using seedRandom and posterizeTime but it will just snap from value to value, and I'd like it to ease in out and stop for a while. Does that make sense?

Thanks in advance.

Something like this maybe:

 

segDur = 1;
minVal = 0;
maxVal = 100;
seg = Math.floor(time/segDur);
seedRandom(seg,true);
curVal = random(minVal,maxVal)
seedRandom(seg-1,true);
prevVal = random(minVal,maxVal);
t = time%segDur;
ease(t,0,segDur/2,prevVal,curVal)

 

 

Dan

Topics

Expressions, How to, Scripting

Views

42

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Guide ,
Aug 07, 2020

Copy link to clipboard

Copied

Something like this maybe:

 

segDur = 1;
minVal = 0;
maxVal = 100;
seg = Math.floor(time/segDur);
seedRandom(seg,true);
curVal = random(minVal,maxVal)
seedRandom(seg-1,true);
prevVal = random(minVal,maxVal);
t = time%segDur;
ease(t,0,segDur/2,prevVal,curVal)

 

 

Dan

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Aug 07, 2020

Copy link to clipboard

Copied

jeez! Mr Ebberts coming to rescue for the zillion time.

That's exactly what I needed. If you got a dollar for each answer all over the internet you'd be a billionaire.

Thank you very very much Sir.

Appreciated!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...