3
\$\begingroup\$

I'm using unity 4.6. I saw a couple of UI masks tutorials and saw that there's a certain hierarchy I can't seem to break:

  • -Canvas
  • --- Panel (holds the mask component)
  • --------Image

I want to move the mask and leave the image in its place.

(Attach the mask to a moving object, and by that, exposing the image by the moving object position)

I have 2 problems with it:

My moving object barely moves my mask (I guess because of the canvas). The image is a child of the mask, so even if it will move, it will move with it. Can I even do it?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

I Solved this by detaching the image from the mask parent, move the mask, and then reattach it (Set the image's parent to the canvas and after moving the mask set it to be the image's parent again). That way the image stays still and the mask is slowly revealing the image.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ You could also do this... 1)Save the position of image. 2)Move the panel. 3)Restore the position of image. \$\endgroup\$
    – Xtro
    Dec 30, 2014 at 20:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .