8 Replies Latest reply on Oct 8, 2016 4:57 PM by tiagoBRcastro

    Falling element stop a specific position

    tiagoBRcastro

      I found this expression here for make an object fall from its starting point simulating gravity:

       

      seedRandom(index,true)

       

      mGravBase=9.81; //basic gravity

      mGravVar=random(-1,1); //gravity variation

       

      mAccel=time*(mGravBase+mGravVar);

       

      X=value[0];

      Y=value[1]+Math.pow(mAccel,2);

       

       

      [X,Y]

       

      But this make the object fall forever, how can I set the last position of the animation and make it stop?