---
title: "setValueForXAxis(_:yAxis:)"
framework: gamecontroller
role: symbol
role_heading: Instance Method
path: "gamecontroller/gccontrollerdirectionpad/setvalueforxaxis(_:yaxis:)"
---

# setValueForXAxis(_:yAxis:)

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

## Declaration

```swift
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

Discussion This method does nothing if the associated controller isn’t a snapshot (its isSnapshot property is false). Otherwise, this method sets the value of the direction pad’s buttons as well.
