- Home /
Hide/Show part of a GameObject
Hello
I have a GameObject that has the mesh of an arrow.
I want this arrow to "power" up like a power bar.
My idea is to have 2 arrows in the same place where one of the arrows is hidden.
Then when the user presses "Space" the hidden arrow slowly begins to be revealed, however I have no idea how to do this.
The idea is similar to this: (Except this is 2D)
Are you looking for a 3D version of the power up arrow in your pic there?
If I understand you correctly, then yes.
I want a 3D version of what my link contains :-)
2DToolkit contains proper clipped sprites, you just adjust a variable and the cut moves up and down. incredibly handy.
Answer by Casper 1 · Mar 07, 2012 at 07:10 PM
After a lot of research I ended up using masking which I achieved by reading and using this http://www.unifycommunity.com/wiki/index.php?title=DepthMask
Answer by PAEvenson · Feb 25, 2012 at 03:14 AM
I suggest researching animated textures. You COULD fade in the gameobect based on the material's alpha, but it will fade in the whole gameobject. You could also do it in a shader, but it would be rather complicated. I suggest looking at animated textures first.,The simplest solution would be using an animated texture. You COULD slowly fade in a gameobject using the materials alpha value, but you will only be able to fade in the whole object. You could also possibly write a shader to do it, but it would be rather complicated. Research animated textures first. If you feeling ballsy research some shader stuff. You will need to use a mask for the arrow, then scale and interpolate the colors based on the height. Hope this points you in the right direction.
Answer by amuzulo · Apr 19, 2012 at 08:11 AM
If you want a really simple solution, another possibility is to put a cube in front of the area you want to hide and make it the same color as the background.