Search Unity

Make 2d game using only UI & Canvas elements

Discussion in '2D' started by sunburnedgames, Jul 21, 2015.

  1. sunburnedgames

    sunburnedgames

    Joined:
    Jul 20, 2015
    Posts:
    8
    Hi devs!

    We are designing a strategy card game based on hexagonal grid for the battlefield. Now the base is implemented using the UI system but we are not sure if implement all the gameplay logic using only UI is the best way or maybe is better use the 2d system.

    In addition we want to use 3d objects and particle effects....

    pros and cons?

    Thanks
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    I tried to make a tabletop cardgame using only the unity UI and I ran into a ton of trouble. Like seriously... a ton of trouble. I recommend using UI only for menu's and to overlay information. Try to keep your game pieces and game logic outside of the canvas.

    Eventually I got it to work, but it was a huge hassle and a lot of time and effort wasted, and everything I've learned from solving these problems are just about inapplicable anywhere else. I don't remember quite all the problems that arose, but the number one problem that is bad enough to not use UI on it's own is layering. I swear to you, you will spend about 1/4th of your time trying to get things layered correctly (especially particles). Every time you fix one thing, 2 other things will be layered incorrectly. I ended up in such a nasty cycle of this, I had to start using several different cameras and camera layers to layer things THAT way. The UI uses a stencil system that makes little sense, I believe it's supposed to draw things back-to-front in the order they appear in the hierarchy, but I've found situations that break that rule for reasons I cannot begin to understand (changing z-value has nearly no effect on layering).

    I know I just sorta regurgitated a lot of useless information here, but my number one point I'm trying to get across is that trying to build a game using only UI has caused me so much unnecessary pain, work, and caused saddening sacrifices in game quality. Don't do it!!!!!!
     
    theANMATOR2b likes this.