---
title: "positionY(_:)"
framework: spritekit
role: symbol
role_heading: Type Method
path: "spritekit/skconstraint/positiony(_:)"
---

# positionY(_:)

Creates a constraint that restricts the y-coordinate of a node’s position.

## Declaration

```swift
class func positionY(_ range: SKRange) -> Self
```

## Parameters

- `range`: The range to restrict the coordinate to.

## Mentioned in

Creating Position Constraints

## Return Value

Return Value A new constraint.

## Discussion

Discussion Each time when constraints are applied, the y-coordinate of the node’s position property is clamped so that it lies inside the specified range.

## See Also

### Creating Position Constraints

- [Creating Position Constraints](spritekit/creating-position-constraints.md)
- [positionX(_:y:)](spritekit/skconstraint/positionx(_:y:).md)
- [positionX(_:)](spritekit/skconstraint/positionx(_:).md)
