- Community Superstar
- Has been a member for 2-3 years
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Author was Featured
- Author had a File in an Envato Bundle
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
Hello folks,...
So, it maybe pretty simple and stupid, but I didn’t know how to move objects diagonally, but linear. If you seperate x,y,z position, you can’t grab both x,y and move them.
my x=372 my y=708
What I want to do is to slide x and so than y slides along…
I added this expression to y: transform.xPosition+336 (where the 336 is difference between these two)
Then when I slide x, it does what I want. But, is there a simple solution and am I really stupid 
- Author was Featured
- Item was Featured
- Sold between 100 000 and 250 000 dollars
- Most Wanted Bounty Winner
- Author had a File in an Envato Bundle
- Has been a member for 5-6 years
- Referred between 100 and 199 users
- Bought between 100 and 499 items
- Italy
my faster answer will be to parent your layer to a null and give the null a vertical motion.
Ben will be here soon 
- Community Superstar
- Has been a member for 2-3 years
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Author was Featured
- Author had a File in an Envato Bundle
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
What you mean, vertical motion?
- Author was Featured
- Item was Featured
- Sold between 100 000 and 250 000 dollars
- Most Wanted Bounty Winner
- Author had a File in an Envato Bundle
- Has been a member for 5-6 years
- Referred between 100 and 199 users
- Bought between 100 and 499 items
- Italy
EFEKT_Studio said
What you mean, vertical motion?
Sorry for my bad english.
I mean change pos on the Y axis.
- Community Superstar
- Has been a member for 2-3 years
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Author was Featured
- Author had a File in an Envato Bundle
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
This is what I did. I rotated null by 45°, parented object’s x to null’s x, and object’s y to null’s y and when I move null’s x, I get the what I want. Still, I think there is an eaiser way to do this 
- Community Superstar
- Has been a member for 2-3 years
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Author was Featured
- Author had a File in an Envato Bundle
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
I mean, all I would have to do is to rotate the object’s axis by 45° but I don’t know how to do that. Actually I don’t think it’s possible.
- Community Moderator
- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Item was Featured
- Author had a File in an Envato Bundle
- Beta Tester
- Has been a member for 4-5 years
- United Kingdom
Hi Efekt,
I think this is pretty simple with some simple trigonometry, but I’m not entirely sure what you’re trying to achieve. For a 45 degree angle, the code you have in your original post is perfect and as simple as it can be. Do you want the movement to be at a different angle?
Could you phrase it a bit more clearly?
f.
- Community Superstar
- Has been a member for 2-3 years
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Author was Featured
- Author had a File in an Envato Bundle
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
felt_tips said
Hi Efekt,I think this is pretty simple with some simple trigonometry, but I’m not entirely sure what you’re trying to achieve. For a 45 degree angle, the code you have in your original post is perfect and as simple as it can be. Do you want the movement to be at a different angle?
Could you phrase it a bit more clearly?
f.
Hey Felt, maybe I didn’t explain it well, since picture is more than 1000 words…
Object has rotation values at 0, but object has a mask which gives an impression that object is z rotated by 45°. Now I want to move object in diagonal axis perfectly, like I would move it along x or y axis. I hope you understand what I mean…

2 keyframes or linear(time,start,end,point1,point2) would be easier. diagonial is a move described from x=y and an angle of 45 degrees but the fact that (0,0) is top left makes things complicated
- Sold between 50 000 and 100 000 dollars
- Community Moderator
- Referred between 1000 and 1999 users
- Author had a File in an Envato Bundle
- Most Wanted Bounty Winner
- Item was Featured
- Author was Featured
- Contributed a Tutorial to a Tuts+ Site
Hey!
I’ve made a little project file for you 
2 Points
Control
Preview
Conclusion

Expressions
per = effect("Percent")("Slider");
if(per <= 0) { per = 0.001; }
start = thisComp.layer("Starting Point").transform.position;
end = thisComp.layer("Ending Point").transform.position;
dx = end[0] (minus) start[0]; //replace minus with the simbol, forum wont display it correctly
dy = end[1] (minus) start[1]; //here also
[dx * per + start[0] , dy * per + start[1]]
This is a very simple expressions. First i calculate the difference in x and y values between the point. Then i simply multiply the values with the “Percent” and add that value to the Starting Point.
