---
title: "value(at:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gknoisemap/value(at:)"
---

# value(at:)

Returns the value at the specified position in the noise map’s discrete sample grid.

## Declaration

```swift
func value(at position: vector_int2) -> Float
```

## Parameters

- `position`: The position to query in the noise map’s grid of sampled noise values. Must be within the rectangle from [0, 0] to the noise map’s doc://com.apple.gameplaykit/documentation/GameplayKit/GKNoiseMap/sampleCount value.

## Return Value

Return Value The value at the specified position.

## Discussion

Discussion When you create a noise map from a GKNoise object, GameplayKit performs the noise generation and processing computations necessary to fill a discrete grid with noise samples. (You specify the size of the grid and its number of samples in the init(_:size:origin:sampleCount:seamless:) initializer.) Use this method to get sample values from that grid. You can also use the interpolatedValue(at:) method to query positions that are not on the discrete integer grid of samples.

## See Also

### Accessing Noise Values

- [interpolatedValue(at:)](gameplaykit/gknoisemap/interpolatedvalue(at:).md)
- [setValue(_:at:)](gameplaykit/gknoisemap/setvalue(_:at:).md)
