hey not sure if I’m doing this right, but I’m trying to make an inventory system where if you pickup something i retrieve some data from the object into my inventory.
don’t get the error because I’m not using an abstract class, but clearly I’m doing something wrong.
in the inventory script
static var ItemList:List.<Items>;
static class Items
{
var name:String;
var type:String;
function Items (name:String, type:String)
{
name=this.name;
type=this.type;
}
}
hey thanks for the reply, makes sense. although i have other scripts where the class and function have the same name and work…?
anyway console coughs up this error: Assets/jethro/pickUp.js(21,61): BCE0017: The best overload for the method ‘System.Collections.Generic.List..Add(Items)’ is not compatible with the argument list ‘(void)’.