---
title: "moveBy(x:y:duration:)"
framework: spritekit
role: symbol
role_heading: Type Method
path: "spritekit/skaction/moveby(x:y:duration:)"
---

# moveBy(x:y:duration:)

Creates an action that moves a node relative to its current position.

## Declaration

```swift
class func moveBy(x deltaX: CGFloat, y deltaY: CGFloat, duration: TimeInterval) -> SKAction
```

## Parameters

- `deltaX`: The x-value, in points, to add to the node’s position.
- `deltaY`: The y-value, in points, to add to the node’s position.
- `duration`: The duration of the animation.

## Return Value

Return Value A new action object.

## Discussion

Discussion When the action executes, the node’s position property animates from its current position to its new position. This action is reversible; the reverse is created as if the following code is executed:

## See Also

### Animating a Node’s Position in a Linear Path

- [move(by:duration:)](spritekit/skaction/move(by:duration:).md)
- [move(to:duration:)](spritekit/skaction/move(to:duration:).md)
- [moveTo(x:duration:)](spritekit/skaction/moveto(x:duration:).md)
- [moveTo(y:duration:)](spritekit/skaction/moveto(y:duration:).md)
