2412 posts Small, but tough
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+9 more
EFEKT_Studio says

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 :D

594 posts
  • Has referred 100+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+9 more
flashato says

my faster answer will be to parent your layer to a null and give the null a vertical motion.
Ben will be here soon :)

2412 posts Small, but tough
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+9 more
EFEKT_Studio says

What you mean, vertical motion?

594 posts
  • Has referred 100+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+9 more
flashato says

What you mean, vertical motion?

Sorry for my bad english.
I mean change pos on the Y axis.

2412 posts Small, but tough
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+9 more
EFEKT_Studio says

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 :)

2412 posts Small, but tough
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+9 more
EFEKT_Studio says

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.

5257 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+11 more
felt_tips Moderator says

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.

2412 posts Small, but tough
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+9 more
EFEKT_Studio says

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…

117 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $100+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
fAntasticmE says

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

1820 posts Videohive author & moderator
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has referred 1000+ members
  • Helps us moderate the forums
+11 more
Mocarg Moderator says

Hey!

I’ve made a little project file for you :)

2 Points

  • Starting Point
  • Ending Point
  • Control

  • Percent
  • Preview

    Conclusion

  • Adjust the point, select the object layer and in the effects panel play with the “Percent” value to get it moving between the lines. :)
  • 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 :S
    
    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.

    Download

  • Download *.AEP for After Effects CS4
  • Helpful Information

    • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
    • Open a support ticket if you would like specific help with your account, deposits or purchases.
    • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

    Most of all, enjoy your time here. Thank you for being a valued Envato community member.

    Post Reply

    Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

    <strong></strong> to make things bold
    <em></em> to emphasize
    <ul><li> or <ol><li> to make lists
    <h3> or <h4> to make headings
    <pre></pre> for code blocks
    <code></code> for a few words of code
    <a></a> for links
    <img> to paste in an image (it'll need to be hosted somewhere else though)
    <blockquote></blockquote> to quote somebody

    :grin: :shocked: :cry: Complete List of Smiley Codes

    by
    by
    by
    by
    by
    by