<!--
{
  "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/GCControllerDirectionPad/setValueForXAxis(_:yAxis:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Game Controller"
    ],
    "preciseIdentifier" : "c:objc(cs)GCControllerDirectionPad(im)setValueForXAxis:yAxis:"
  },
  "title" : "setValueForXAxis(_:yAxis:)"
}
-->

# setValueForXAxis(_:yAxis:)

Sets the input values of a snapshot of a directional pad.

```
func setValueForXAxis(_ xAxis: Float, yAxis: Float)
```

## Parameters

`xAxis`

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

`yAxis`

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

## 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>`)`. Otherwise, this method sets the value of the direction pad’s buttons as well.

---

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)