Variables:
public List<List> squads = null;
private int numsq = 0;
public List _selectedUnits;
Problem code:
if(Input.GetKeyDown(KeyCode.F) && _selectedUnits != null){
squads[numsq] = _selectedUnits;
numsq++;
}
I’m trying to implement squads into my RTS. I used the multiple selection code here:
http://forum.unity3d.com/threads/69067-Rts-unit-selection-problem
And that works fine, but when I hit F it comes back with an error pointing to the list assignment above:
NullReferenceException: Object reference not set to an instance of an object
Help please!