Adding an array to a list. throws a nullreference exception


This line of code apparently doesn’t work, and throws a nullreference. I’m attempting to find all objects tagged player, and put them into a generic list of gameobjects called players.

What’s wrong with it?

does the players object exist? Did you call new?