Object reference not set to an instance of an object

Here is a screenshot of the file in the inspector.

Imgur

I have this script attached to “main camera” in a blank scene.

THanks!

You just didn’t set _PlayerStats

Set it by “dragging it in” in the Editor. ie, look in the Inspector and drag stuff in to the variable.


I beg your pardon, you can’t set a List in the Inspector

Short answer to your problem: you have never initialised or filled-up that list, _PlayerStats

that’s the problem!

look around for a zillion examples on initializing List !

basically like = new List (blah) :wink:

Cheers