Forum Replies Created

  • Toni Pa

    May 14, 2014 at 6:48 pm in reply to: start moving when reaching CONDITION if

    Ok I get it, but why the first example works well? if the x.position will be always geting bigger… because im moving the layer to the right
    Anyway I think I would try a different approach, without parenting.
    Thank you!

  • Toni Pa

    May 14, 2014 at 8:44 am in reply to: start moving when reaching CONDITION if

    ups I may have talk to fast…
    It works perfect for the example i posted but in my real project I’m tracking the position of a child object and when I tried to adapt the code I got an error caused for an infinite loop.
    I also tried:
    while ((P[2]>800)&&(P[2]>900))
    but it didnt work…
    Any idea to solve this?

    * I will explain the scene: I got a group of objects (trees houses…) as child of a road (solid 90º rotation) which moves back into the horizon. When I reach the horizon ( z position= 800) I want the objects move down to be hidden into the ground.

    Thank you all for your time

    L=thisLayer;
    P=L.toWorld(L.anchorPoint); //position of the child P[0] x, P[1] y, P[2] z

    v=30; //velocity

    if (P[2]>800) {
    t = time;
    while (P[2]>800) {
    t-=thisComp.frameDuration;
    }
    transform.zPosition.valueAtTime(time-t)*v; // the z.position is actually y position because the parent has 90º rotation...
    } else {
    transform.zPosition;
    }

  • Toni Pa

    May 14, 2014 at 7:52 am in reply to: start moving when reaching CONDITION if

    Thank you for your fast answer!
    Works perfect 🙂

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy