Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

looking for advice (simple card game)

Discussion in 'Getting Started' started by Expediter, Feb 25, 2015.

  1. Expediter


    Feb 25, 2015
    Hello everyone,
    I am extremely new to unity and am a moderate programmer ( simple stuff nothing big). I have decided to take on a simple project as I have been craving to create something for a while. I have decided to make an extremely simple "trading card game" with unity.

    I am looking for a little advice on how to handle cards and a GUI in a card game. currently I have a game "scene" with 5 cards that are draggable from a "hand" and you can place the cards from the hand onto the game board(that is all my game is at the moment). once the card is on the game board section , that section changes its image to signify a card is there. I was using the GUI and adding text when I started feeling like I am probably doing this all wrong.

    Currently I am making cards in Photoshop, importing them into unity and then dragging them into my scene as sprites. I attach scripts to the sprites and arrange them the way I want. I started wondering , should I be making these cards in the GUI somehow ? instead of just dragging them into the scene as sprites? Can scene elements interact with GUI elements ? I want to make sections on the board were the cards must be placed, should that functionality be in a GUI or just as a bunch of sprites in a scene that change as I drag and drop?

    my final goal is an extremely simple trading card game with RPG elements, to make things simple the player will start with a static hand, no dynamic card generation from deck or anything like that. I want to start game with an enemy card that just sits there and a hero card that has two "equipment slots" were I can place cards on. different cards do different damage to enemy until enemy is dead, that's it. This is meant to be a learning exercise but I feel like I need some advice / direction at this point.

    thank you for any/all advice.
  2. Kiwasi


    Dec 5, 2013
    Answer is it depends.

    UI elements are ultimately just sprites with some extra stuff attached. You can do all of the same stuff you do with UI with just plain sprites and the extra stuff. And if your cards are animated in 3D I would probably suggest this as a better option then using the UI. The UI has some performance hits with excessive movement.

    To handle clicks on physics objects you can simply add the appropriate collider to the object and a physics raycaster to the camera.