Perspectives in a Card Game


I wanted to avoid creating 2D digital designs for the table and the background of my game (I'm no artist...). So I've decided to make it 3D.

I wasn't convinced by the look of an orthographic camera so I went with a narrow FOV perspective camera.

But now that my cards are 3D objects, how can I make sure they don't intersect with the table when flipping?

I used two cameras for that:

After setting the environment on a separate layer, I simply had to set the first camera's Culling Mask to the Environment layer only, and its Depth to 0. The main camera has the Environment excluded from its Culling Mask, Clear Flags to Depth Only and its Depth to 1!

WebGL
When porting to WebGL, it was no longer possible to handle that feature. The number of cameras being limited to one, the environment wasn't rendering.  
So I had a more traditional camera sitting in the scene, and if I detect the platform to be WebGL, I just turn this camera on and the others off!

Get Sacrifice - The Card Game

Leave a comment

Log in with itch.io to leave a comment.