UserInputService not working in plugins

In Plugins if you try to use UserInputService it doesnt work until we have focused the Viewport
How to fix this??

if this cant be fixed then is there a workaround?

In Roblox plugins, the UserInputService is indeed not fully functional as it is in the game’s runtime environment, primarily because plugins run in a different context that doesn’t have access to the same input handling mechanisms. This is due to the way plugin contexts in Roblox are designed, as they are not meant to handle user input in the same way that regular games do.

If UserInputService is not working as expected in your plugin until you focus the viewport, it’s likely because the plugin’s user interface is not receiving input focus initially. Unfortunately, there isn’t a direct way to fix this since it’s a limitation of how plugins operate in Roblox.