problems with my list

hi. so this here i also talked about in my last question but now that i have really looked into my code i found where the bug is. or rather i found the bug carrier.

so my trouble is when i make a random call into the list and i end up with the last item in the list it throws an arguement out of range error and then give me the last item AND another item

here is the code

public class Deck : MonoBehaviour
{

public GameObject Hand;
public GameObject dDeck;
public GameObject gGarrison;
public GameObject[] Cards = new GameObject[5];
public List<GameObject> deckCards = new List<GameObject>();


int randomInt;

// Use this for initialization
void Start()
{


    

    Cards[0] = Instantiate(Cards[0], transform.position, transform.rotation) as GameObject;
    Cards[1] = Instantiate(Cards[1], transform.position, transform.rotation) as GameObject;
    Cards[2] = Instantiate(Cards[2], transform.position, transform.rotation) as GameObject;
    Cards[3] = Instantiate(Cards[3], transform.position, transform.rotation) as GameObject;
    Cards[4] = Instantiate(Cards[4], transform.position, transform.rotation) as GameObject;

    foreach (GameObject card in Cards)
    {
        card.SetActive(false);
        card.transform.SetParent(dDeck.transform);
        Debug.Log("Parent set");
        if(card.tag != "Garrison")
        {
            deckCards.Add(card);
        }

        

            if (card.tag == "Garrison")
        {
            card.transform.SetParent(gGarrison.transform);
            card.SetActive(true);
            Debug.Log("garrisons placed");

        }
    }
}

// Update is called once per frame
void Update()
{
    foreach (GameObject item in deckCards)
    {
        item.SetActive(false);
    }
}

public void ChooseRandom()
{
    if (Hand.GetComponent<Hand>().RecievedCard == false)
    {
        randomInt = Random.Range(0, deckCards.Count);
        Hand.GetComponent<Hand>().cardsInHand.Add(deckCards[0 + randomInt]);
        deckCards[0 + randomInt].transform.SetParent(Hand.transform);
        deckCards.Remove(deckCards[0 + randomInt]);
        deckCards[0 + randomInt].SetActive(true);
        Hand.GetComponent<Hand>().HaveRecieved();
    }
}

}
`

I believe this is your problem:

deckCards[0 + randomInt].transform.SetParent(Hand.transform);
         deckCards.Remove(deckCards[0 + randomInt]);
         deckCards[0 + randomInt].SetActive(true);

you remove an item from the list, but your randomInt stays the same, which COULD be out of range because it was a random integer based on 0 - Length. You may want to move that last line up one:

deckCards[0 + randomInt].transform.SetParent(Hand.transform);
         deckCards[0 + randomInt].SetActive(true);
         deckCards.Remove(deckCards[0 + randomInt]);