- Home /
How to clip game objects to a rectangular area?
I'm trying to figure out how to do this but am coming up short. I'm making a slot machine in unity 2d and would like to clip the tile prefabs when they leave a given rectangular area.
I can't seem to figure out how to do this. All of the references I've found say to use a clipping shader with a mask texture, but it seems like massive overkill to use a masking texture when I just need an easy pre-defined rectangular area.
Right now the "machine" game object just adds and removes children to itself and has no actual drawing component, would I have to add something that draws?
If You use the uGUI system, it has a mask system. What is your tile made of? Sprite? Could you provide a screenshot of your scene?
$$anonymous$$y tiles are arbitrary prefabs, but for now are made of sprites. Here's a screenshot of the game running with the heirarchy showing what's going on.
Your answer

Follow this Question
Related Questions
Alpha cutoff of sprite based on another texture 1 Answer
Masking an image 0 Answers
Inverse Depth Masking 2D Sprites 0 Answers
Vertically scrolling 2D background clips 2 Answers
2d game questions 0 Answers