I’ve taken the time out of my day to create a repro for this issue (you can pay me later)
BugPlugin.rbxm (1.6 KB)
plugin:Activate(true)
should (as far as I know, as the DevHub offers no information on the subject) cause the cursor to stop acting as the select tool, allowing plugin developers to code their own functionality for how the mouse interacts with the viewport. If you call Button:SetActive(false)
like you should be, this is only the case for the first button selection you make until the plugin has been deactivated.
Reproduction:
- Click on the the button “Thing A”
- Try selecting a part (it won’t select, this is intended behavior for
plugin:Activate(true)
) - Now click on the Button “Thing B”
- Try selecting a part (it will select, this is NOT intended behavior)
Now you can click “Thing B” a second time to deselect that tool. at this point there should be no buttons highlighted.
Repeat Steps 1-4 again, but this time do “Thing B” first, followed by “Thing A”. The behavior depends on whichever button was clicked first.
Now you may contrast this with the following adaptation of the plugin:
BugPlugin_No-SetActive(false).rbxm (1.6 KB)
In this version, all I’ve done is comment out line 7 where I call :SetActive(false)
on the currently active button. If you follow steps 1-4 again, but with this plugin, you will find that all of the behavior works exactly as intended. Both tools, no matter how or when you select them, prevent the mouse from behaving like the select tool. The only issue with this is that now the buttons are permanently highlighted and it’s indistinguishable if the tool is active or not.
This behavior is undocumented, and the DevHub explanation of this function appears to be that this should be a purely visual change, but it’s not. Please fix.