Attributes - Now Available!

How would this work for existing property names? How would this work for children with the same name? Which would have more precedence? This is already an issue where Roblox adds conflicting property names, that is why you should use :FindFirstChild for getting instances from name. So they likely only allow interacting with attributes through getters and setters so this issue is avoided.

5 Likes

Dirty ValueBases be gone! Is it recommended to cache GetAttribute and update the cache on AttributeChanged? Or does roblox already do this?

I know for ValueBases you have to do this if you’re reading from a value frequently

8 Likes

Awesome! I will 100% have a go with this. :grinning_face_with_smiling_eyes:

2 Likes

Awesome!

I closed Studio to renew some items and when I came back and selected an item, the properties showed “Add Attribute”.

This is finally here, as it takes away configuration folders and values.

1 Like

I am disappointed that the beta post mentioned implementing new value types, and yet Object and CFrame, the most requested value types, have yet to be supported.

Nice update nonetheless.

5 Likes

@WallsAreForClimbing

  1. Can we have a list of supported types?

  2. I assume that Attributes behave like CollectionService for replication?
    (Server will overwrite / remove Client Attributes)


AttributeService supports using Instance as an Attribute

2 Likes

Love the update, Happy its out now!

2 Likes

I’ve been waiting for this! I can finally make my items (dropped items ingame) have proper IDs attached without having to deal with using a value object! Not to mention the uses this will have for oop

3 Likes

Object values are pretty understandable. What if you stored an array of instances in an attribute, and one of the instances was destroyed. Would the array have a hole? It’s just asking for confusing replication behaviors.

7 Likes

Speaking of arrays, I don’t think you can store multiple objects in a single attribute to begin with. That’s another high-demand feature.

3 Likes

This is gonna be soo useful for game development so you don’t have piles of values in models or parts. Good addition! Also will be good used with OOP.

5 Likes

Seems handy! Are there any performance benefits to using Attributes over Value Instances?

2 Likes

Will attributes ever support tables or sub-data within a field similar to Position having (X,Y,Z)?

5 Likes

Fantastic feature. Wow! I can’t wait to try porting some features over to this. Will have to do testing! Good work Roblox Staff.

1 Like

For now I believe what you do can is, json-encode your array when setting, and json-decode when getting, but I think native support would be much better, and it not returning a copy, so you can do table.insert(inst:GetAttribute(name)[, i], v) and it will apply to the same table and not return a new one each time

1 Like

This going to be a Fire feature in Roblox Studio now all I just got to do is learn how to use and incorporate it into my Roblox game.

2 Likes

I did notice that there isn’t an Object option for the attributes, I can easily just use an ObjectValue for the specific instance that would need one, but will there be an Object attribute in the future??

3 Likes

This is fantastic, already in the middle of changing EVERYTHING in my current projects! A little extra thing that would be pretty cool would be the ability to add headers in between the attributes, kinda like Unity -
image

For some objects, I have variables set by both me and my scripts, so being able to organize these would be awesome!

7 Likes

Oh I see. It looks like binary strings are supported (like "\0\1\2\3"), so you can store raw data using string.pack. You would need to set up your own studio tools to edit these values though. The main use for array support would just be studio convenience.

It looks like I’ll be using attributes to store massive binary strings. We can finally store strings with "\0" characters and it supports values longer than 200,000! I have a lot of code dedicated to escaping "\0" and separating binary strings longer than 199,999 into multiple StringValues.

3 Likes

THIS. IS AMAZING!!! GONE ARE THE DAYS OF FORGETTING TO BUT ValueTypeInstance.Value!!! BYE BYE, VALUES! :happy4: :happy4: :happy4: :happy4: :happy4: :happy4: :happy4: :happy4:

5 Likes