zebadeee

Random Motion w/Random pauses

Jan 19th, 2023
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. moveMin = .3; //minimum move time
  2. moveMax = .7; //maximum move time
  3.  
  4. pauseMin = .1; // minimum pause time
  5. pauseMax = .5; // maximum pause time
  6.  
  7. minVal = [0.1*thisComp.width, 0.1*thisComp.height];
  8. maxVal = [0.9*thisComp.width, 0.9*thisComp.height];
  9.  
  10. seedRandom(index,true);  // set pre-run for endT
  11. endT = - random(moveMax);
  12.  
  13. j = 0;
  14. k = 0;
  15. while ( time >= endT){
  16.   j += 1;
  17.   seedRandom(j,true);
  18.   startT = endT;
  19.   if (j%2){
  20.     endT += random(moveMin,moveMax);
  21.     k++;
  22.   }else{
  23.     endT += random(pauseMin,pauseMax);
  24.   }
  25. }
  26. if (j%2){
  27.   seedRandom(k,true);
  28.   endVal = random(minVal,maxVal);
  29.   seedRandom(k-1,true);
  30.   startVal = random(minVal,maxVal);
  31.   ease(time,startT,endT,startVal,endVal)
  32. }else{
  33.   seedRandom(k,true);
  34.   random(minVal,maxVal)
  35. }
Add Comment
Please, Sign In to add comment