Masking out portions of a GameObject's children
Hi Everyone,
I'm struggling with something that feels like it should be fairly simple, so thought I would ask before possibly going off in completely the wrong direction.
I recently completed an app version of a card/strategy boardgame intended for tablets. Players have hands of 6 cards. I designed the layout of the game so that all cards are legible without the need for constant zooming.
https://www.dropbox.com/s/lyh9w1sldp2wri6/game.jpg?dl=0
It's working well but I wasn't able to release the game to phones because the text on the cards ended up being too small. Now, I'm trying to correct that.
I've magnified the size of the card greatly so that 2 out of 6 can be displayed on screen. To access the others the user can swipe or just move his finger on the left side of the screen to scroll a parent object that contains all 6 cards.
The problem is that I have 2 such player boards close to one another and when the player slides that card holder object up, it will obscure the opponents cards. When the player turn ends or if the player decides to take a look at his opponent's board the display is messed up.
I've highlighted an area in red which is showing the problem, but it can actually be much bigger and worse than what I'm displaying here.
This is what my full game world looks like.
https://www.dropbox.com/s/p8ppy01ivolpmyg/FullScene.jpg?dl=0
==================
My question is: Is there a (fairly easy) way for that sliding panel that contains all 6 cards to mask out everything except that region beside the player's board so that 1 player's cards never intrude on the others?
I could probably avoid the problem just by spacing out player 1 and player 2's boards in the game world so there's never any overlap, but I would like to avoid that because I make use of camera animations to move between the two boards after a player plays a card. There's an advantage to keeping things spaced closely together.
Answer by peterk1968 · Mar 21, 2016 at 01:58 PM
I've been thinking about it some more and it looks like the best solution would be to go into blender and create a new plane to use for my wood tabletop. If I create some portholes in the plane exactly where the players' hands are displayed, I can then position the cards slightly below the tabletop and when the user slides up/down, the uneeded cards will then get masked by the tabletop.
Bit of work, but it's sounding good.
...or, I can replace my one big tabletop plane with a bunch of smaller ones that will also give me the same effect. This will probably be a lot less work. Will have to check if it still looks good that way.
Your answer
Follow this Question
Related Questions
[2D] Generating small translucent circles inside a large rectangle 0 Answers
Cover up (or mask) portion of gameobject(s) 0 Answers
Disable Avatar Mask 1 Answer
New Unity Sprite Mask alpha support 1 Answer
Invisible transition mask 0 Answers