i have this array of my “Buff” class (or at least i thought it was.)
var buffs: Buff;
then later when i try to add a buff to the array:
buffs.Add(newBuff);
and it says .Add is not a member of “Buff”. i must have created the array wrong? but i’m not sure how.
clunk47
2
You should be using a Generic List.
#pragma strict
import System.Collections.Generic;
var buffs : List.<Buff> = new List.<Buff>();
function Start()
{
buffs.Add(newBuff);
}
Not sure what newBuff is, or if you were trying to add (new Buff)… If you still have troubles, I’ll need to see your Buff class.