ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Link Opacity to Y position

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Topher Blair
Link Opacity to Y position
on Apr 5, 2017 at 10:46:26 pm

Hi,
I need to be able to link Opacity to the Y position of an object. If the object is above -80 y position, it needs to be full. If it's below 80, it needs to be at 0% opacity. if it's between the two it needs to fade. Is there a way to accomplish this?

Thanks!


Return to posts index

Topher Blair
Re: Link Opacity to Y position
on Apr 5, 2017 at 11:16:29 pm

Hi, I actually miswrote what I meant. If y is less than 460, then I need opacity needs to be 100%, if it's greater than 620, it needs to be 0%


Return to posts index

Topher Blair
Re: Link Opacity to Y position
on Apr 5, 2017 at 11:22:07 pm

Actually I think I've figured it out. Not sure that this is the most elegant solution, but this is what I came up with...

if (transform.position[1] &lt; 460) t = 0 else
t = (transform.position[1] - 460)/160
linear(t, 100, 0)


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]