My game uses a custom movement system. “UserInputService.InputEnded” doesn’t detect when the user has stopped moving the Thumbstick1 on Console (ie: This simply does not run)
UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Thumbstick1 then
print("INPUT ENDED WITH THUMBSTICK 1")
end
end)
Another way that should work is to tell if the user’s input position on Thumbstick1 has become 0, 0, but this also doesn’t always work & is inconsistent for different devices. Many users report that the last input detected does not show a thumbstick at a position of 0, 0 and instead the last detected thumbstick input is something like -3, 0, etc.
UserInputService.InputChanged:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Thumbstick1 then
local x: number = input.Position.X
local y: number = input.Position.Y
local roundX = math.round(x * 100)
local roundY = math.round(y * 100)
print(roundX, roundY)
if roundX == 0 and roundY == 0 then
print("Player has released thumbstick input")
return
end
end
end)
A solution is to increase the range of motion where the game thinks input has ended, like this:
if roundX <= 3 and roundX >= -3 and roundY <= 3 and roundY >= -3 then
print("Player has released thumbstick input")
return
end
but this means that the thumbstick will be a lot less sensitive for other users and it doesn’t cover every kind of device (there’s definitely going to be at least a few players that exist outside of this range and they can’t be covered without making it less sensitive for every player)
Like all “analog” or “continuous” input types, InputEnded (and InputBegan for that matter) never fires because the input never ends (or begins) – its a continuous stream of data.
With that said, you are actually on exactly the right track here! The idea that you developed on there is called a “thumbstick deadzone”, a region within which the thumbstick’s analog input is considered to be zero.
Typically, the gamepad’s driver software manages this for you and will faithfully return a value of 0 when the hardware deadzone is properly configured, but either Roblox itself isn’t processing this correctly or you and your testers’ gamepads don’t have properly configured hardware deadzones, which explains the very low “centered” value of 0.03. Notice that the article I linked uses a deadzone of 0.2, as does Roblox’s gamepad controller as @qnime mentioned.
You’re correct that setting an arbitrary value on this is problematic, but Roblox already normalizes the inputs to the (-1,1) range for you on each axis, (possible [-1, 1], I’m not actually sure) so the majority of the work is done already. If you’re worried about it, you can create a setting for it in your game to let people select their own deadzone value, but in my experience it’s really not a big deal to lose a little bit of precision on thumbstick inputs, especially if you smooth out the transition out of the deadzone as described in the article I linked so that it’s continuous instead of jumping to that first non-deadzone value.