Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Expression with delay using position

New Here ,
Dec 02, 2021 Dec 02, 2021

Hi, I have a doubt and im wasting too much time.

 

First of all, i have  this expression:

delay = thisComp.layer("Graphics delay").effect("Slider Control")("Slider"); //
d = delay*thisComp.frameDuration;
thisComp.layer("22%").transform.yPosition.valueAtTime(time - d)

 

So this expression its working well but i want to increase the value of the position to have the object a little bit up (only 42px up on yposition).

 

How can i fix that expression to have the delay and the yposition substract working well together?'

 

Thanks

 

TOPICS
Expressions , How to
148
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 02, 2021 Dec 02, 2021

Nothing fancy required. You could just add the -42 at the end. Other than that you can of course always employ any number of tricks like applying the expression to a Null or point expression control and parenting/ connecting the actual layer to that, then manualyl offset it or just the same using the Transform effect. Realyl depends on what specifically you have in mind.

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 02, 2021 Dec 02, 2021
LATEST

I don't know how this expression is working or where you are using it. 

 

yPosition does popup if you start typing but yPosition does not return the Y position of any position property. It is not defined.  You need to be using something like this and you have to generate an array:

delay = thisComp.layer("Graphics delay").effect("Slider Control")("Slider"); //
d = delay * thisComp.frameDuration;
newPos = thisComp.layer("22%").transform.position.valueAtTime(time - d);
vOffset = 200; // vertical offset
[newPos[0], newPos[1] + vOffset]

When you get in trouble with expressions it is always a good idea to start with the Understanding the expression language help page. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines