<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKAction/moveTo(y:duration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKAction(cm)moveToY:duration:"
  },
  "title" : "moveTo(y:duration:)"
}
-->

# moveTo(y:duration:)

Creates an action that moves a node vertically.

```
class func moveTo(y: CGFloat, duration: TimeInterval) -> SKAction
```

## Parameters

`y`

The y-value for the node’s new position.

`duration`

The duration of the animation.

## Return Value

A new action object.

## Discussion

When the action executes, the node’s [`position`](/documentation/SpriteKit/SKNode/position) property animates from its current position to its new position.

This action is not reversible; the reverse of this action has the same duration but does not move the node.

---

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)