MouseButton2 input not firing when using UserInputService at InputEnded event

This is the code:

local UIS = game:GetService("UserInputService")
UIS.InputEnded:Connect(function(input)

	print("Input ended: " .. tostring(input.UserInputType))
	print("-------------")
	
end)

When I’m holding left click, then press right click the event isn’t firing MouseButton2 (right click), instead it fires MouseButton1 even though im still holding it.

Try this yourself if you want to on an empty baseplate

1 Like

This actually works for me:

image

1 Like

is this just an issue with my client then :cat:

1 Like

Why a cat? You have no fur


Is there any UI in your game? If you right click UI, it may sink the input so it doesn’t get to the script.

1 Like

I do have an UI, but when I tried on an empty baseplate with just the script I sent the same thing happened

1 Like

Turns out the issue is my mouse or computer, I have tried with 3 different mouses and I got the same issue. I’m not sure how I will fix this but its not a roblox studio bug

Why not use the mouse object using the player?

local player = game:GetService("Players")
local Mouse = player:GetMouse()

Mouse.Button2Up:Connect(function()
 -- Do stuff
end)

this was written on mobile

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.