Basically I’m working on a plugin to zoom in on UI objects (or im trying to) and I seen to be experiencing some draw backs with what I’m doing.
I’m currently using the PluginMouse but before I was using UserInputService but that didn’t exactly work as planned so I ditched it and just used it for checking if they are holding Ctrl while scrolling, now my current issue is It triggers the mouse moved function (isn’t exactly relevant to my plugin but currently used for debugging purposes)
when selecting any instance it works perfectly fine but if you select the StarterGui or anything inside of that it just doesn’t trigger those events, Now you might be seeing where my issue starts to come into play. I’m going to be using the plugin literally when you have a UI object selected as thats how it will detect what to zoom into except I don’t really know any work around for this. If I can get some assistance with this that would be greatly appreciated.

Current code
local Connections = {}
local UserInputService = game:GetService("UserInputService")
plugin:Activate(false)
local PluginMouse = plugin:GetMouse()
local function LoadSystem()
warn("Loaded")
Connections["SelectionChange"] = game:GetService("Selection").SelectionChanged:Connect(function()
plugin:Activate(false)
end)
Connections["MouseWheelUp"] = PluginMouse.WheelForward:Connect(function()
if UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) then
local Succ, Error = pcall(function()
warn("up_")
local ActiveSelection = game:GetService("Selection"):Get()
local ZoomOnScreenUI = nil
for _, IsScreen in pairs(ActiveSelection) do
if ZoomOnScreenUI == nil then
ZoomOnScreenUI = IsScreen:FindFirstAncestorOfClass("ScreenGui")
end
end
warn("UP", ZoomOnScreenUI.Name)
end)
if not Succ then
warn(Error)
end
end
end)
Connections["MouseWheelDown"] = PluginMouse.WheelBackward:Connect(function()
if UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) then
local Succ, Error = pcall(function()
warn("down_")
local ActiveSelection = game:GetService("Selection"):Get()
local ZoomOnScreenUI = nil
for _, IsScreen in pairs(ActiveSelection) do
if ZoomOnScreenUI == nil then
ZoomOnScreenUI = IsScreen:FindFirstAncestorOfClass("ScreenGui")
end
end
warn("DOWN", ZoomOnScreenUI.Name)
end)
if not Succ then
warn(Error)
else
print("succ")
end
end
end)
Connections["MouseMoved"] = PluginMouse.Move:Connect(function()
print("Moved")
end)
end
local function UnloadSystem()
warn("Unloading plugin lol")
for _, UnloadConnection in pairs(Connections) do
UnloadConnection:Disconnect()
end
end
LoadSystem()
plugin.Unloading:Connect(function()
UnloadSystem()
end)
