struggling with Playing card game in unity
Hi,
I am new to unity ,I am planning to develop a card based game (similar to 29 card game). There should be 4 players in the game. Initially I just want to shuffle the cards and each one gets 8 cards . I just want to show the cards to each players and players can move one card at a time to the center of the board.
I am planning to buy cards from store to use in my game.
Q1) Should I apply rigid body concepts to each cards .? or any other techniques to represent the cards as object. Q2) Can I move the card with out applying physics and find whether it reaches center of the board ?
Q3) How to show all 8 cards to players ? should I use textures ? please guide me
Thanks
This belongs on the forums. There are three distinct questions, one of which requires a subjective answer ("Should I...?").
Answer by Karishi · Mar 01, 2018 at 01:12 AM
Q1) You need to apply a rigidbody to an object if its physicality - things like its ability to run into things - is important. There are almost no card games where this is true, so you probably don't need one. You can make the cards as 3D Planes, very thin 3D "cubes" (3.5 by 2.5 by 0.01, basically), or as sprites. Though if you're buying a card package from the store they'll probably already be defined as something.
Q2) You can! "Move" just means "change the location in space," so if your code allows you to change the Transform Position of the card object you'll be moving the object even if it doesn't interact with regular physics. You could drag and drop objects straight through objects and that would work. In most card games that's fine - for instance not being able to knock your virtual cup of coffee over is more of a feature than a bug if you're playing solitaire. Unless you're planning on making randomized game boards, you can probably get away with telling the card to "go to [specific x,y,z coordinates]" rather than figuring out detection, but if you want to learn about detection by location I recommend the "kill box" section of the Space Shooter tutorial, here: https://unity3d.com/learn/tutorials/projects/space-shooter-tutorial/boundary?playlist=17147
Q3) I don't have a handle on multiplayer mechanics yet. I don't have any insight to offer there. However, if you're buying a pack of cards from the store they'll almost certainly have a format already in place. If you want to use them, you'll be using that format.