Forum Replies Created

Page 47 of 65
  • Andrei Popa

    August 8, 2019 at 10:33 am in reply to: If don’t move, keeps rotating.

    It’s a bit more complicated but we can find a workaround. Just tell me some more details of its movement. Does it move using keyframes? And how many? Does it stop after it starts moving?

    Andrei
    My Envato portfolio.

  • Andrei Popa

    August 7, 2019 at 7:56 am in reply to: Horse track game

    So i think you only talk about the race.
    Make one comp for each horse.
    Separate dimensions.
    Set x to middle of the comp.
    Modify y as you wish it to look.
    Add this expression to x.

    wiggle(0.1, width/2)

    You can modify the first parameter of wiggle to have more randomness(that says how often it will change position).

    However, I can’t think of a way to make the start.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    August 7, 2019 at 7:22 am in reply to: If don’t move, keeps rotating.

    Is this what you are after?

    a = time*20;
    b = transform.position[1]*-1;
    p = transform.position;
    if (p.velocityAtTime(time)[1] > 0) {a
    }else{
    b
    }

    Andrei
    My Envato portfolio.

  • Andrei Popa

    August 5, 2019 at 7:20 am in reply to: Add expression that only affects first keyframe

    If the anchor point is not set there by expression, it will move when you make the rectangle bigger. Put this expression in the anchorpoint, in case you don’t already have one:


    var left = sourceRectAtTime(time,false).left;
    [left,value[1]]

    Then, the previous expression should work as it is.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    August 5, 2019 at 7:12 am in reply to: Add expression that only affects first keyframe

    I suggest you separate position dimensions(right click on position>Separate Dimensions).
    I don’t know how your shape layer looks like(how its anchor is positioned etc) so this is an aproximation of what you will need. You need to calculate the newValue by yourself(this depends on where the anchor point is). I assume your key 2 and key 3 have the same value. If so, this is the expression you put in the x property of position

    newValue = - sourceRectAtTime(time).width;
    time2 = key(3).time;
    if(time <key(3).time){
    linear(transform.xPosition,key(1).value, key(2).value, newValue, key(2).value)
    }else{
    linear(transform.xPosition,key(3).value, key(4).value, newValue, key(3).value)
    }

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 29, 2019 at 9:06 am in reply to: Creating a slider randomly moving increments

    Make a text layer. Put this in the sourceText
    var minValue = 0;
    var maxValue = 9;
    length = 50;
    seedRandom(2, timeless = true)
    initialValue = Math.round(random(0, 5));
    for(i=1;i<=length; i++){
    lastElement = parseInt(initialValue.toString().slice(-1));
    direction = (random()>0.5) ? -1 : 1;
    if (lastElement+direction > maxValue || lastElement+direction < minValue){
    direction = -direction;
    }
    initialValue +=""+(lastElement+direction)
    }

    Changing seedRandom first value creates another string(in case you dont like the one generated).

    Then, to the slider add this:
    dur = 5;
    string = thisLayer("Text")("Source Text");
    i = Math.floor(time/framesToTime(dur));
    (string.length>i) ? string[i] : value;

    Where dur is how many frames should the slider hold the value.

    Andrei
    My Envato portfolio.

  • Try this. Put all the names in a comp. Add a slider effect to the first one. Add this expression to the slider, so it only gets integer values:

    Math.round(value);

    Then add this to the opacity of each layer:

    (thisComp.layer(1)("Effects")("Slider Control")("Slider") == index) ? 100 : 0 ;

    Andrei
    My Envato portfolio.

  • Try this:

    if (numKeys > 1){
    t1 = key(1).time;
    t2 = key(2).time;
    dur = t2-t1;
    sTime = (time-t1)-(time-t1)%dur;
    sliderStart = effect("Scale Control Start")("Slider");
    v1 = [sliderStart, sliderStart];
    sliderEnd = effect("Scale Control End")("Slider")
    v2 = [sliderEnd, sliderEnd];
    linear(time-t1, sTime, sTime+dur, v1, v2);
    } else {
    value
    }

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 19, 2019 at 1:03 pm in reply to: Auto Center Logo Lock Up

    Im not sure what your problem is. What i would do in this case are 2 other comps in which i put the logos. Inside them i would put a guide layer(a circle or a square) and write somthing like “Please fit your logo inside these shape” and make this text layer also guide layer. This way, you guide them, but these guides don;t show up on render.

    Andrei
    My Envato portfolio.

  • Its called parameter. You do not have to declare it in your program. You just use it inside your function. When you call the function, you insert what is called an argument instead of the parameter. Now the function replaces the parameter inside itself with the argument. Here is a short example to make it easier to understand:

    testFunction("Message"); // alerts "Message"
    testFunction("Another Message"); //alerts "Another message"
    var myString = "The third message";
    testFunction(myString); //alerts "The third message";

    function testFunction(myValue){
    alert(myValue);
    }

    It does not matter if you put the functions at the start or at the end of the program, they still load at the start. I suggest to put them at the end, and with suggestive names, so when you later read your code, you can see at a glance what it does.

    Andrei
    My Envato portfolio.

Page 47 of 65

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