I wanted to create a plugin widget that shows instances that are being selected.
However, I can’t seem to find a way to detect when you select and unselect a selection.
Right now I just have this code on loop, which isn’t very optimized if you decide to select many parts at once.
while wait() do
for i, v in pairs(Selection:Get()) do
-- code here
end
end
I’ve tried to use:
plugin:Activate(true)
plugin:Getmouse().Button1Down:Connect()
but my plugin is meant to work on the side displaying the count live. Since plugin:Activate
would force you to be focused on the plugin and nothing else.
Does anyone know a proper way to detect when instances are being selected/unselected without having to use Selection:Get()
on loop?