PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Set

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 Selection/Get an Instance can be added to the existing selection like so:

local selected = Selection:Get()
table.insert(selected, object)
Selection:Set(selected)

Parameters

Name Type Default Description

An array of Instances to set the current selection to.

Returns

Return Type Summary

Code Samples


Selection Set

This code sample will select every BasePart in the workspace that is Bright red.