• | 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!
• | 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%
• | 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] < 460) t = 0 else
t = (transform.position[1] - 460)/160
linear(t, 100, 0)