Controller's ButtonR3 is reporting MouseMovement as last input type on zoom into first person

Pressing ButtonR3 on a controller to zoom into first person will make the GetLastInputType think the mouse got moved, which messes with my UI and movement that changes depending on last input.

It seems to be the act of going into first person that makes UIS think the mouse got moved.

This also occurs with uis.LastInputTypeChanged

Putting this in a LocalScript in StarterGui on a new baseplate map is enough to repro, or download the place file ButtonR3 repro.rbxl (18.3 KB)

local runservice = game:GetService('RunService')

local uis = game:GetService'UserInputService'

local last_inputted_button = nil
uis.InputBegan:Connect(function(inputobject)
	last_inputted_button = inputobject.KeyCode
end)

runservice.Stepped:Connect(function(DistributedGameTime, dt)
	print('last user input type: ',uis:GetLastInputType(), '::', last_inputted_button)
	
	if uis:GetLastInputType() == Enum.UserInputType.Gamepad1 then
		print'controller'
	else
		print'not controller' --this is printing when only using gamepad & clicking the right thumbstick, when it shouldn't be.
	end
end)

System specs:
Windows 10 PC with USB controller

2 Likes

Extra info: This happens because the mouse is shifted up in third person but it’s centered in first person. So while the mouse does technically move, it shouldn’t be reflected in an API that developers are using to determine what device the player is using.

4 Likes

I’ve had a similar problem where I detect how to setup controls depending on the last input type detected. While using an xbox controller, it could trigger a mouse input which would cause a quick stutter in some of my UIs as they’d change some of the text for buttons. Always just assumed it was because I had my control plugged into my PC tho, idk.

1 Like

Thanks for the detailed report! We should have a fix in the coming weeks.

2 Likes

This issue is still happening to me. When the player presses R3, it outputs MouseMovment in InputChanged.
(Edit: this only happens when the player is switching from third to first person and vice versa, not when the player is zooming in)

1 Like