Better UI Selection

Introduction

Hello developers, today I decided to share a very useful plugin that I’ve made. Currently ui selection sucks. You have to be already selecting ui to select ui again. If you are not selecting ui and you click on a gui object, it does not get selected.

This plugin aims to fix the problem. Now, you can select ui regardless of if you were previously selecting ui.

Demonstration

Note: The plugin has a PluginToolbarButton so you can disable the plugin if needed.

Normal Select: Won’t select because we are not on the ui layer

Normal Select Preview

UI Select Plugin: Selects regardless of whether we are on the ui layer

UI Select Preview

Explanation

The plugin is very simple consisting of only 20 lines. When a user clicks, UserInputService detects that and get’s any ui at the mouse’s position. If there is ui, then select it.

Code

local toolbar = plugin:CreateToolbar("UISelect")
local Button = toolbar:CreateButton("UI Select", "Allows you to select user interface without having to be on the ui layer.", "rbxassetid://7143000156");
local enabled = true
Button:SetActive(enabled)

Button.Click:Connect(function()
	enabled = not enabled
	Button:SetActive(enabled)
end)

UserInputService.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 and enabled then		
		local position = UserInputService:GetMouseLocation()
		local guis = game.StarterGui:GetGuiObjectsAtPosition(position.X,position.Y)
		
		guis = (game.Selection:Get()[1] ~= guis[1] and guis[1]) and game.Selection:Set({guis[1]})
	end
end)

Conclusion

This plugin is very helpful when it comes to ui design. I made a plugin install if you want to use it for yourself. Thanks for reading and have a nice day.

25 Likes

Oooohhh oooooooh oooooooooooh boy!

image

The perfect italian pizza right here. :it:
Thank you comrad

3 Likes

Nice plugin, the only complaint/bug is that it will select frames that are not visible. This could be a setting or just make it visible UI only.

The plugin won’t select frames that aren’t visible. If a frame’s transparency is set to 1, then it will still select it, but it ignores not visible frames.

1 Like

I only have 1 word for this:

Yes

4 Likes

Very useful, one flaw though, it breaks multi-select, unsure if you can fix this but it would be appreciated.

2 Likes

I’m aware of this problem and will be releasing an update in a couple of days that will fix this problem.

2 Likes