title | description |
---|---|
Properties Window |
The Properties window lets you adjust properties of a selected object to change how it looks and behaves. |
The Properties window, accessible from the View tab, allows you to adjust certain properties of a selected object to change how the object looks and behaves. Additionally, you can manage tags and configure instance attributes at the bottom of the window.
When you select an object, the window's header bar changes to reflect both the class and name of the object.
A `Class.Model` named StoneColumn A `Class.Script` named CandleFlickerThe Properties window divides an object's properties into sections. For example, a Class.MeshPart
includes sections like Appearance and Transform which respectively allow you to change its appearance and transform its Class.BasePart.Size|Size
, Class.BasePart.CFrame|CFrame
, and origin.
You can collapse or expand any section or subsection by clicking the small arrow to the left of its name. After you expand or collapse a section, it remains expanded or collapsed for other objects of the same class, as well as related objects that share the same property grouping.
Some properties are collapsed by default, but you can expand them by clicking the small arrow next to its name. For instance, Class.BasePart|BaseParts
contain a Position property which represents an X, Y, Z coordinate in the 3D world. In Studio, these coordinates can be entered in two ways:
You can filter properties by typing a search query into the Filter Properties input near the top of the window. For example, filtering by the letters "velo" finds all properties containing them, such as AssemblyLinearVelocity and AssemblyAngularVelocity. Quickly access this input by pressing CtrlShiftP (⌘ShiftP).
The Tags section allows you to apply specific tags for use with Class.CollectionService
. Tags are sets of strings applied to instances that replicate from the server to the client. They are also serialized when places are saved.
To add tags to an instance through the Properties window:
-
Select the instance, scroll to the Tags section, and click the + button.
-
In the popup window, enter a new tag name or select a tag you've already created for any other instance from the list below the input field. The tag will appear within the Tags section.
-
If necessary, you can remove an existing tag by clicking the × icon.
Attributes allow you to customize instances with your own data. They are similar to built-in object properties, but you can create and modify your own attributes for any instance. Key features include:
- Attributes can be created, edited, and deleted directly within the Properties window, or through scripting.
- Attributes and their values are saved with your place and assets.
- Value changes can be viewed in real time and are replicated so that clients can access them immediately.
Examples of attribute usage include:
-
Weapons with attributes such as damage, fire rate, shot sound, and reload time.
-
Vehicle tuning like acceleration and top speed, body color, and engine sound.
-
Additional package or asset metadata such as description, version, and author.
You can store the following types/values in attributes:
- [string](../luau/strings.md)
- [boolean](../luau/booleans.md)
- [number](../luau/numbers.md)
- `Datatype.UDim`
- `Datatype.UDim2`
- `Datatype.BrickColor`
- `Datatype.Color3`
- `Datatype.Vector2`
- `Datatype.Vector3`
- `Datatype.EnumItem`
- `Datatype.NumberSequence`
- `Datatype.ColorSequence`
- `Datatype.NumberRange`
- `Datatype.Rect`
- `Datatype.Font`
- `Datatype.CFrame`
New attributes can be created and modified in Studio as follows:
-
Select the instance, scroll to the bottom of the Properties window, and click the + button.
-
In the popup window, enter the attribute Name, select its Type, and click Save.
-
The new attribute will appear with a default value that you can change just like any other property.
-
If necessary, you can rename or delete an attribute by clicking the gear icon.
Attributes can also be created and controlled through scripts.
To create an attribute or modify an existing attribute's value, call Class.Instance:SetAttribute()
with a name and value.
local weapon = script.Parent
-- Create an attribute
weapon:SetAttribute("ReloadTime", 3)
To get the value of one existing attribute, call Class.Instance:GetAttribute()
on the instance.
local weapon = script.Parent
-- Create an attribute
weapon:SetAttribute("ReloadTime", 3)
-- Get current attribute value
local reloadTimeValue = weapon:GetAttribute("ReloadTime")
print(reloadTimeValue)
Similarly, you can get all attributes of an instance by calling Class.Instance:GetAttributes()
. This returns a dictionary of string/variant pairs representing each attribute.
local weapon = script.Parent
-- Create attributes
weapon:SetAttribute("ReloadTime", 3)
weapon:SetAttribute("FireSound", "rbxassetid://3821795742")
-- Get all instance attributes
local weaponAttributes = weapon:GetAttributes()
for name, value in weaponAttributes do
print(name, value)
end
To delete an attribute, call Class.Instance:SetAttribute()
with a value of nil
.
local weapon = script.Parent
-- Delete an existing attribute
weapon:SetAttribute("ReloadTime", nil)
To listen for value changes on one or more attributes:
- Connect
Class.Instance:GetAttributeChangedSignal()
for one specific named attribute. - Connect
Class.Instance.AttributeChanged
for any attribute on the instance.
local weapon = script.Parent
--- Listen for one specific attribute change
weapon:GetAttributeChangedSignal("ReloadTime"):Connect(function()
print(weapon:GetAttribute("ReloadTime"))
end)
-- Listen for any attribute change on the instance
weapon.AttributeChanged:Connect(function(attributeName)
print(attributeName, weapon:GetAttribute(attributeName))
end)