- Home /
How to hide an area of a sprite
I am trying to dynamically hide an area of a sprite by a collider which overlays the sprite, with these details:
The hidden area gets the same shape as the overlaying collider;
The hidden area follows the overlaying collider position;
The main camera projection is orthographic.
This illustration may explain this better:

Is there a proper solution to realize this?
Thank you in advance.
Answer by fafase · Dec 07, 2014 at 03:07 PM
I think this could be of some help:
That works, but this way the hiding object must have a mesh, and what I need is to use a collider to hide sprites. Furthermore it seems that this still treatable. Thank you for the response.
I don't know if my answer was uploaded or not, but if it was...I'll delete this one.
I would use either sorting layers, but if anything, use 3d depth to your advantage. But sorting layers, in my opinion, are better.
Refer to here, or look here. I hope I was of help, and best of luck with you project! (Nice image you used there, by the way. It looked really cool!)
sorting layers will hide the object. here the point is to make part of the object transparent. I don't think layers would fix this.
Your answer
Follow this Question
Related Questions
Shaders to show damage? 1 Answer
Refreshing the Polygon Collider (2D) upon sprite change? 1 Answer
UI Image doesn't react to OnMouseDown() 3 Answers
Overlay texture on sprite 0 Answers