Forum Replies Created

  • After doing some research I see that I cannot have my If/else statement inside of a variable like I had. As well as after the && I needed to add back in the “Rot” variable.

    And also I pasted my code wrong in the forum :P.


    //Old expression
    Rot = transform.rotation;
    Ctrl = thisComp.layer("Controller").effect("Width")("Slider");
    Factor = if(Rot >0 && <90) {
    Rot;
    } else if(Rot >90 && <180) {
    180 - Rot;
    } else if(Rot >18 && <270) {
    180 - Rot;
    } else if(Rot >270 && <360) {
    (360 - Rot)*-1;
    } else

    value;

    Factor * Ctrl;

    So instead I moved my slider controller into the If/else. And I fixed some of my math. Plus the 90º and 270º needed their own statements.
    If anybody has a cleaner / better way of doing this please let me know. I've been trying my hardest to write everything from scratch and I am getting better, but i know I may be doing things the long and hard route. Haha


    //New Code
    Rot = transform.rotation.value;
    Ctrl = thisComp.layer("Controller").effect("Width")("Slider");
    if (Rot >0 && Rot <90) {
    (Rot * Ctrl);
    } else if(Rot == 90) {
    (Rot)* Ctrl;
    } else if(Rot >90 && Rot <180) {
    (180 - Rot)* Ctrl;
    } else if(Rot >180 && Rot <270) {
    (180 - Rot)* Ctrl;
    } else if(Rot == 270) {
    (-90)* Ctrl;
    } else if(Rot >270 && Rot <360) {
    (360 - Rot)*-1 *Ctrl;
    } else
    0;

  • Matthew Russell

    September 27, 2018 at 7:46 pm in reply to: Adding this wiggle expression to position

    This worked perfectly!
    It also worked to give my particles inertia!

    Thanks a bunch Dan!

    Also I use your alpha triggers animation expression all the time! Great stuff!

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