Reputation: 11
Here is my code...
for (int Position = 0; CardsInDeck.Length; Position++)
{
if (RandomlySelectedCard == CardsInDeck [Position])
{
Position = 0;
} else {
CardsInDeck [Position] = RandomlySelectedCard;
}
}
Unity is telling me that it cannot convert int to bool, but I have checked everything and it looks good. I am making a card game by the way.
Upvotes: 1
Views: 74
Reputation: 846
Your for loop says:
for (int Position = 0; CardsInDeck.Length; Position++)
the second argument in the for loop is supposed to be a condition hence it should be:
for (int Position = 0; Position < CardsInDeck.Length; Position++)
Upvotes: 6