Help: "reference not set..." error trying to access a list in a scriptable object.

I guess you’re new to C#?

This:

public List<Card> chosenCards;

… isn’t a list object. It’s a field that can refer to such a list. You’ve not initialized it so it’ll be NULL so accessing “chosenCards” will give you a Null reference exception.

public List<Card> chosenCards = new List<Card>();

Here’s how to post code on the forums btw: Using code tags properly

1 Like