As a Roblox developer, it is currently impossible to standardize attribute behavior in a script, as there is no ObjectValue attribute, as reported here:
Firstly, while this is a great idea I was able to get a response from a staff member regarding why it hasn’t yet been done.
Some detail on those particular cases you mentioned:
The big problem with Instance attributes is that we actually have to adjust the Attributes API to support them, because the default Instance… = nil, which is the same as not having an attribute at all in the existing API. We only really get one shot at how we adjust the API to support Instances and there’s disagreement over the best solution. It will happen eventually.
The issue for dropdown / Enums is the schema problem: Where do you store the list of potential options? If you store it on every single Instance which has the attribute, that’s a significant waste of memory, especially if the list of options is large. There are solutions to this, but again, we only really get one shot at choosing how we do it, so no solution has made it all the way to shipping yet.
Thanks, but in practice, regardless of any justifications, the fact is that if it is currently possible to store an instance inside an ObjectValue property, it is not difficult to do the same for attributes. It’s just a matter of goodwill
I’m trying to use attributes more in my coding to utilize user-friendliness, their replication efficiency and their compatibility with Streaming Enabled. But the major flaw is not being able to set an instance as an attribute.
Same. I also struggle to think of substantial barriers to adding the feature. I may be mistaken but given that objects are already properties, such as in constraints, I think most of the work is done already.
The issue is the “initialisation state”. How do you define it on an Instance in the properties window.
The default state of the Instance property type is null, which conversely, undefines an attribute. For ObjectValue its not a problem because Value is a fixed property which handles null as expected.
The staff member said there’re different solutions they’re considering. Since he didn’t specify what the different considerations actually are, we’re left to guess. Nevertheless, clearly there are multiple solutions, the engineers just need to agree on which one to employ.