Card over cards

Hello,

I am trying to build a game of cards. I am looking for a method that I can drag a card over another as in reality. Let me explain: suppose two cards A and B. How to make the map A, when I positione it with mouse at the same place as B, starts above B and not below. And this rule should also apply for the card B if I move it. Will you please advise me a good way to get there . I tested rigidsbody, the caracters controllers, but I can not. It would be really nice if someone could give me an example with two planes.

Thanks

If I understand you correctly, you simply want to move the card that’s being dragged a bit up to make sure it’s above the other cards. You most definitely want to use an orthographic camera for this. If I were you I’d keep a list of all the cards, and implement a z-order. Whenever a card is picked set its z-order to 0, and increment the z-order of every other card. The card’s real z position is someNominalZ + (zOrder*0.1);

Thank you for your reply,
That’s exactly right, but I do not know if your method would work because you have to imagine that the cards can be anywhere on the table as in reality. They can be single, group 2, group 3, etc…