I'm making a classic card game in Unity. I created the first deck, and when I click on the top card, it is discarded and moved to a second card stack. When the first card stack is empty, then it is refilled, when it is clicked. Furthermore, I should to be allowed to drag and drop the cards in to the second deck.

My problem is that I can't drag and drop a card from the second deck until the first deck was refilled a first time and I don't understand why.

Why am I having this weird behaviour?

  • \$\begingroup\$ You should really try to pinpoint the problematic area, we can't look at your project and solve the problem for you. It would take too much time to solve any one project by itself. Images or gifs of the problem will help and a detailed explanation will also help. \$\endgroup\$ – John Hamilton Apr 20 '17 at 5:29
  • \$\begingroup\$ Indeed, it seems that your having a debug problem; but to ask an on topic debug question, you must provide a minimal, verifiable example of the problem, via code. Even though you have provided an answer, since, without actually knowing how this problem started, this question is off-topic, and rather unuseful for future users. \$\endgroup\$ – Gnemlock Apr 29 '17 at 1:20
  • 1
    \$\begingroup\$ ....and you should avoid uploading content on external sites and post links to it as they tend to rot. As such, I remove the link to the content removed by the host you used, because the content was no longer available. \$\endgroup\$ – Vaillancourt May 1 '17 at 10:01

I solved the problem. I flip a card by a rotation quaternion, so the normal of the card will be in opposite position of the casted ray when I click. Since this a 2D project, I decided to simulate the card rotation by scale vector (by uniform scale on the x component).


Not the answer you're looking for? Browse other questions tagged or ask your own question.