I’m trying to make a custom number sequence editor for my particle editor plugin,
The issue is a mouse events don’t fire when a mouse is on the widget.
I have tried activating the plugin, MouseButton events and UserInputService but none of it worked.
Here is the code :
local runService = game:GetService("RunService")
local userInputService = game:GetService("UserInputService")
local toolBar = plugin:CreateToolbar("test")
local newbutton = toolBar:CreateButton("test","test test","http://www.roblox.com/asset/?id=5464564564563")
plugin:Activate(true)
local mouse = plugin:GetMouse()
local widget = plugin:CreateDockWidgetPluginGui("V32OP",DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float,
false,
false,
200,
300,
300,
350
))
local button = script.Parent.TextButton
button.Parent = widget
userInputService.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
print("UIS mouse down")
end
end)
userInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
print("UIS mouse up")
end
end)
mouse.Button1Down:Connect(function()
print("mouse down")
end)
mouse.Button1Up:Connect(function()
print("mouse up")
end)
widget.Enabled = true
Is there a reason that you’re not using button.MouseButton1Click:Connect(...) here? Do you need all input at all times or just when clicking the button?
Oh I’m sorry, i forgot to mention that i had tried it. It only works if user mouse is released on it, but I’m making a graph editor where the keyframe is dragable and i need mouse up input to stop update the key position.
I already used MouseButton1Down to detect when the user start dragging, but the problem is i can’t detect when they stop dragging. MouseButton1up wouldn’t work if their mouse wasn’t on the button.