- Home /
How to mask gameObject by gameObject
Hello
How to mask gameObject by gameObject is there any shader or plugin to do that
thx
(Firas)
Can you please explain im more detail what you mean by "mask gameObject by gameObject", and what exactly you are trying to accomplish? It is not clear.
Answer by Wolfram · Jun 03, 2012 at 09:36 AM
This is what you are looking for: http://wiki.unity3d.com/index.php?title=DepthMask
@xXJuanXx It works with Unity 4.x - it seems in Unity 5 the existing mesh+meta data is being ignored/destroyed.
However, just construct your own example: create an object that will be the mask, the invisible part that is supposed to "cut away" parts of other GameObjects. Apply the "$$anonymous$$asked/$$anonymous$$ask" shader to that object.
For this object to actually cut away stuff, just add the script "SetRenderQueue" to all object that should be cut. That's all.
Note you will have to be in Play mode to see the effect.
Answer by tanyanzhi · Jun 02, 2015 at 01:00 AM
There is a component called Mask in UGUI could help you, if you are using UGUI.
Answer by Berenger · Jun 02, 2012 at 03:03 PM
You can disable the renderer or deactivate the gameobject. This is going to make the object disappear instantly. If you want it to fade, you need a transparent shader. There is the built-in ones and you can download them here if you want to look them up.
thx brother for your answer but i want to show part of gameobject , not disabled totally
i hope that is there a solution
Then you should go with a transparent shader and an alpha map, if there is only one mesh.
Your answer
Follow this Question
Related Questions
How to add second shader to gameobject as a mask for RenderWithShader 0 Answers
overlap between scenes!!! 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
How to Get Gameobject position on screen resolution that not passed the resolution to set 0 Answers
Switch to New Shader and Back to Original object's Shader in C# Script 0 Answers