I have an unusual problem with my List. The code looks like this:
tanks = new List<Tank>();
tanks.Add(new Tank("Player", position1, false));
tanks.Add(new Tank("Enemy", position2, true));
if (tanks[0] == null) Debug.LogError("tanks[0] == null");
For some reason the error appears. Why does it happen? If I call List.Count, it returns 2... Can someone help me?