zebadeee

Move / Hold / Random Time

Apr 17th, 2021
689
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. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×