This member cannot be used in scripts, but is usable in the command bar and plugins.
Sets the currently selected objects in Roblox Studio to
Instances in the given array.
Calling this function will cause the
Selection/SelectionChanged event to fire, unless the new selection set is identical to the previous selection.
Note this function overwrites the existing selection. However, using
Instance can be added to the existing selection like so:
local selected = Selection:Get() table.insert(selected, object) Selection:Set(selected)
An array of
This code sample will select every
BasePart in the workspace that is Bright red.