<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameController",
  "identifier" : "/documentation/GameController/GCControllerTouchpad/setValueForXAxis(_:yAxis:touchDown:buttonValue:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Game Controller"
    ],
    "preciseIdentifier" : "c:objc(cs)GCControllerTouchpad(im)setValueForXAxis:yAxis:touchDown:buttonValue:"
  },
  "title" : "setValueForXAxis(_:yAxis:touchDown:buttonValue:)"
}
-->

# setValueForXAxis(_:yAxis:touchDown:buttonValue:)

Sets the input values of a snapshot of a touchpad.

```
func setValueForXAxis(_ xAxis: Float, yAxis: Float, touchDown: Bool, buttonValue: Float)
```

## Parameters

`xAxis`

A normalized value of the x-axis ranging from `-1` to `1`.

`yAxis`

A normalized value of the y-axis ranging from `-1` to `1`.

`touchDown`

A Boolean value that indicates whether the user starts touching the surface. If <doc://com.apple.documentation/documentation/Swift/true>, the user is touching the surface; otherwise, the user isn’t.

`buttonValue`

A normalized number between `0.0` (minimum) and `1.0` (maximum) that represents the level of pressure the user applies to the button.

## Discussion

This method does nothing if the associated controller isn’t a snapshot (its [`isSnapshot`](/documentation/GameController/GCController/isSnapshot) property is <doc://com.apple.documentation/documentation/Swift/false>`)`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)