Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Position of a text layer is dependent on decimal/size of another text layer

  • Position of a text layer is dependent on decimal/size of another text layer

    Posted by Christian Simpson on February 26, 2018 at 11:48 pm

    So I have attached a slider to control a specific text layer but I was wondering how I can make the position of another text layer be affected based on how large or how many decimal places the original text layer is. To put it simply I would like the 2nd text layer to always have the same amount of space from the 1st text layer.

    As in the example I would simply like the word Views to butt up against the number with the same space no matter how large the number gets.

    Christian Simpson replied 8 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    February 28, 2018 at 1:04 pm

    numberPosition = thisComp.layer("number").transform.position;
    distance = thisComp.layer("Null 1").effect("Slider Control")("Slider");
    tempY = numberPosition[1];
    tempX = numberPosition[0]+distance+thisComp.layer("number").sourceRectAtTime(time,false).width;
    [tempX,tempY]

    The first 2 variables should be “pick-whipped”. First is the position of your counter layer and second is the distance you want to aquire. Both layers should be left aligned.
    Another way would be to mjust make one solo layer. If you have an expression for your number, you should add ” views” to its value. Something like
    value + " views";

    Andrei
    My Envato portfolio.

  • Christian Simpson

    February 28, 2018 at 2:32 pm

    Thank you very much Andrei!

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