Search code examples
luauser-inputrobloxgamepad

User Input with Gamepad Thumbsticks; How to use input.Delta


I am working with UserInputService and am trying to use the thumbsticks on the gamepad. I have gotten the detection of movement with them, but I was wondering what input.Delta.X or Y means/what it represents.


Solution

  • From https://developer.roblox.com/en-us/api-reference/property/InputObject/Delta

    Delta

    A Vector3 describing the Delta (change) between mouse/joystick movements.

    This is useful when used with the input’s position to track the position and movement of the user’s mouse/joystick, such as when you’re creating custom movement or camera scripts. Consider tracking input object changes using the Instance.Changed event or when user input changes via events such as UserInputService.InputChanged and GuiObject.InputChanged.

    Delta.X and Delta.Y are the x and y components of that vector.

    The documentation even comes with examples on how to use them.