[SOLVED] Cut out part of UI

Hey,

I’m wondering if it’s possible to remove a certain part of the UI. I’m not talking about removing components, rather overwriting parts of the UI with the transparency, if that explanation made any sense.

Basically, I want to achieve an animation like this:

I was thinking of having a rectangle object cover the text object and then turn the rectangle somehow invisible to basically achieve the effect of the text getting cut off.

I have no idea how I would go about that; any help is appreciated.

You can use the Unity’s UI system for this.

  1. Add a UI text to the game (GameObject > UI > Text)
  2. Create a new game object called MyClippingMask under the CanvasElement. Resize the anchors to desired size, and then zero out the Left/Top/Pos Z / Right / Bottom so that the dimensions are taken from the anchor extents.
  3. Make the UI text a child of the new game object (MyClippingMask)
  4. Add these components: Image, Mask to the new clipping game object
  5. Enjoy!!

2236319--149096--Screen Shot 2015-08-05 at 11.24.53 am.png 2236319--149098--Screen Shot 2015-08-05 at 11.28.17 am.png2236319--149097--Screen Shot 2015-08-05 at 11.26.57 am.png

3 Likes

Thank you very much! Worked perfectly :slight_smile:

So this work for the terrain? I am using the starter assets touch controls and my own UI elements but as soon as I go close to the terrain at an angle I lose half my UI or all of it? I thought it was a depth thing or something else, clipping etc, but it seems the terrain is in front of even the UI which is Bizarre! Any help would be much appreciated, it’s probably something simple as usual! cheers