I have the following very basic code, and I just can’t seem to figure out what’s going wrong. No matter what I change I get the error “An object reference is required to access a non-static member”.
public Battalion battalion;
void Update()
{
Battalion newBattalion = Instantiate(battalion) as Battalion;
UnitCare.addBattalion(newBattalion);
}
Where addBattalion is a very simple:
public void addBattalion(Battalion battalion)
{
battalionList.Add(battalion);
}