Objects as Attributes

Hi all,

I see here that there are only a limited number of types that can be assigned for attributes, but I was wondering if there was any way to use an object, or even fake the use of an object as an attribute?

In an ideal world, I’d like to be able to combine types into one object and then have a list of those objects. In Unity, the equivalent allows you to make dynamic arrays of variables containing whatever you need to fill in, and looks something like this:

struct Obj {
  string x;
  Sprite y;
  Sprite[] z;

  Obj(...) { //set here }

//set in editor
public List<Obj> ObjList;

The goal would be to have an object allow for strings, numbers, sprites (or image elements), and more, in any configuration as necessary.

I realize that in the worst case scenario, I could probably load them in with a script initialization, but losing access to easily setting that up in editor would be rather disappointing.

Unfortunately, not yet.

Your best workaround here is to have separate array attributes of each property in the struct and then either us it as is or assign the values to a an object array on initialisation.

Any chance that this feature is in the pipeline or close to release?

Speaking of close to release, if I can ask: I notice that in the beta-manual here and in a recent post by Will here, templates are close to release. Any chance there’s an estimated date on those being available in editor as compared to a Soon™? Looking forward to them.

I don’t think they can give you a date, as it will make them commit to it. From what I gather, I believe we can expect it during next 2-3 weeks :slight_smile: Fingers crossed ^^

Unfortunately, it’s in the spec phase so it won’t be any time soon.

Ah, currently this is in closed beta to iron out edge cases etc. I’m hoping it be within the next month alongside Basis texture compression support and deprecation of the JSON model/animation format in favour of GLTF. :slight_smile:

1 Like