Skip to content

Selection

Supported Class Services NotCreatable Service

The Selection service controls the Instances that are selected in Roblox Studio.

3 Nova members · 6 modern Roblox members not implemented yet

Description

The Selection service controls the Instances that are selected in Roblox Studio.

This service is particularly useful when developing Plugins, as it allows the developer to access and manipulate the current selection.

Currently selected Instances can be obtained and set using the Selection.Get() and Selection.Set() functions. The Selection.SelectionChanged event fires whenever the current selection changes.

For more information on using Selection and Plugins, see Plugin.

Selection is also often used in the command bar, to set hidden properties or run functions for selected Instances.

Note this class only applies to Roblox Studio and has no applicability to games.

Inheritance

Object → Instance → Selection

Nova inheritance: Instance → Selection

Methods

Get Supported Function Returns an array of currently selected Instances in Roblox Studio.
Selection:Get(): Objects

Returns an array of currently selected Instances in Roblox Studio.

If no Instances are selected, the array returned will be empty. This function can be used in conjunction with the Selection.SelectionChanged event to get the selection whenever it changes.

Note, this function can only be used in Plugins or the command line.

For changing the current selection, please see Selection.Set().

Roblox reference signature
Selection:Get(): Instances
Security: PluginSecurity

Roblox documentation

Set Supported Function Sets the currently selected objects in Roblox Studio to Instances in the given array.
Selection:Set(Objects selection)

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:

Roblox reference signature
Selection:Set(selection: Instances): null
Security: PluginSecurity

Roblox documentation

Events

SelectionChanged Supported Event Fires when the Instances selected in Roblox Studio changes.
SelectionChanged()

Fires when the Instances selected in Roblox Studio changes.

Note this event does not give the new selection. Developers will need to use the Selection.Get() function to obtain the current selection.

Although this event can be used outside of plugins and the command bar, it only applies to the selection in Roblox Studio and therefore has no functionality outside of Studio.

To change the selection use the Selection.Set() function.

Roblox documentation

Inherited members

Inherited from Instance: 8 properties, 36 methods, 7 events. They are documented on the base class page.

6 modern Roblox member(s) are not implemented yet — expand to inspect

Members declared by Roblox's Selection class (or by a missing base class) that Nova does not expose. Use this list to scope a migration; the compatibility guide has the recommended workaround.

Properties

Member Signature Status Notes Flags
SelectionThickness SelectionThickness: float Not yet The thickness of the selection highlight outline drawn around selected Instances in Roblox Studio's viewport. ReadOnly, NotReplicated

Methods

Member Signature Status Notes Flags
Add Selection:Add(instancesToAdd: Instances): null Not yet Adds the given Instances to the current selection in Roblox Studio. PluginSecurity
AddFocusCallback Selection:AddFocusCallback(priority: int, function: Function): RBXScriptConnection Not yet — RobloxScriptSecurity
ClearTerrainSelectionHack Selection:ClearTerrainSelectionHack(): null Not yet — RobloxScriptSecurity
SetTerrainSelectionHack Selection:SetTerrainSelectionHack(center: Vector3, size: Vector3): null Not yet — RobloxScriptSecurity

Events

Member Signature Status Notes Flags
SelectionChangedThisFrame SelectionChangedThisFrame() Not yet — RobloxScriptSecurity

Roblox reference: Selection

Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.