Hello there, in the position property of the layer you want to animate you can ALT + click on the stopwatch to open the expressions for that property. So in your case, ALT+click on the stopwatch that is on the “position” property for the layer and it should drop down / add a text box with a default expression in (which will do nothing yet)
Then the expression you probably want is the “linear()” expression. Type in this:
—script—
y = 540; // or whatever the default height is, this won’t change
x = linear(time, 0, 5, 150, 2000); //change the x position over time
[x, y] // position property is an array of 2 values for x and y position
—script—
That should do the trick. The linear expression takes 5 arguments, just off the top of my head but in “linear(time, 0, 5, 0, 2000)”
1. The first argument is what you’re measuring, in this case “time”
2. the second argument is when it starts from, in this case 0 seconds
3. the third one is where it ends, so it will keep animating until 5 seconds
4. the fourth one is the value it starts ag
5. the fifth one is the value it finishes at.
So, from 0-5 seconds, the X position will change from 150 to 2000, if that makes sense! The y position is set at the beginning and is static, but you could also put a linear() expression in here to change the height of the layer over time. And if you want to go extra pro, you can add / subtract multiple linear() expressions over different times to get a range of different movement!!
Enjoy!