New Studio Beta: Attributes!

Do you mean this?

I believe he is referring to wanting ::GetAttributed to work similar to how CollectionService works, meaning it would return a table with instances that have a certain attribute.

local InstancesWithAttribute = workspace:GetAttributed("ItemClass") -- returns a table with instances with an attribute by the name of "ItemClass"

I personally don’t see how this could be useful when there’s already other services (CollectionService) that can be used to achieve the same effect.

1 Like

Nah, I meant a function that returns each instance which has a certain attribute.

@Semistare - True but I prefer using attributes as they are a visual aid, it’s not too difficult to create a function myself which I’m doing though.

This looks good. I hope it gets better

im a little confused on why we would have this, can someone explain?

So basically ike public variabes in unity?

Can you support adding methods to Instances? This would be a useful feature and would remove the need for unwrapping them, as that is a process more complicated than it needs to be. It would be cleaner to code and easy to utilize. For examples, one of the projects I’m making requires me to be able to get the closest player from a parts position and this would make the development for that easier. I’m also working on another project where I am simulating physics and it’d be easier to iterate through the parts being simulated and fire a method to detect collision.

1 Like

True. As a noob scripter I literally had no data structure, but now I like set up my projects so they are modular and expandable. This usually includes a framework where I need to perform bar if foo is true or whatever. Now I won’t have to store all that information in dictionaries that are separate from the instances themselves and only contain a reference to the instance! I’m also creating a physics emulator that will move parts while anchored as if they were unanchored to help reduce lag and achieve more realistic physics. It will require me to add my own custom attribute to each object thats basically the anchored attribute for BaseParts. It will be the attribute that determines whether or not I emulate the physics for the part. In other words, it will make the development so much easier!

1 Like

Public variables aren’t limited to unity. Also, who are you speaking to? You forgot to hit the reply button under that persons name so they most likely won’t see your question.

1 Like

No, I am speaking to the post. In unity, when you make a public variable there is this cool feature to adjust it from the viewport. Have you used unity before?

No. I have the application but haven’t actually used it before. I thought you were talking about public variables relative to that class. Do you mean accessible to all scripts?

No, I am talking about how you can adjust the variable in the viewport.

1 Like

I don’t know what the viewport you’re talking about is.

1 Like

Well, it is a feature in unity.

I’ll take your word for it. I’ll look into it though. Thanks.

It would be better to support all Userdatas lol (Even our custom userdatas)! :smiley:

1 Like

What you’re referring to is a process on Unity known as variable exposing. Essentially Unity compiles variables to the inspector (equivalent of the Studio properties tab) based on how they’re written.

There’s many technical reasons why this may not be possible on Roblox that go beyond the subject of this discussion but you can look into the technicality of how it works from Unity’s documentation if you’re curious.

5 Likes

Great!! This gotta help a lot now

2 Likes

I want to suggest two new types of attributes.

First, I suggest the RBXsignal thing. Others scripts will be able to add a :Connect to these attributes that can be fired with :FireAttribute.

And I also suggest a new Function type (and FunctionValue ?) that will be like the OnInvoke propertie of a BindableFunction, it will be a way to store half-compilated functions and execute them with others scripts.

7 Likes

How would the studio know what your trying to do. Like how would it differ a car from a gun from a door and things like that.

1 Like