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)
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.
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)
I take it a fix for this is never gonna happen? So much for the 2020 message saying they should have a fix for in “in the coming weeks”. It’s 2025, and I’m running into this exact issue.