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