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
	last_inputted_button = inputobject.KeyCode

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

System specs:
Windows 10 PC with USB controller

1 Like

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.


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.

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

1 Like