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

# follow(_:asOffset:orientToPath:speed:)

Creates an action that moves the node at a specified speed along a path.

```
class func follow(_ path: CGPath, asOffset offset: Bool, orientToPath orient: Bool, speed: CGFloat) -> SKAction
```

## Parameters

`path`

A path to follow.

`offset`

If <doc://com.apple.documentation/documentation/Swift/true>, the points in the path are relative offsets to the node’s starting position. If <doc://com.apple.documentation/documentation/Swift/false>, the points in the node are absolute coordinate values.

`orient`

If <doc://com.apple.documentation/documentation/Swift/true>, the node’s [`zRotation`](/documentation/SpriteKit/SKNode/zRotation) property animates so that the node turns to follow the path. If <doc://com.apple.documentation/documentation/Swift/false>, the [`zRotation`](/documentation/SpriteKit/SKNode/zRotation) property of the node is unchanged.

`speed`

The speed at which the node should move, in points per second.

## Return Value

A new action object.

## Discussion

When the action executes, the node’s [`position`](/documentation/SpriteKit/SKNode/position) and [`zRotation`](/documentation/SpriteKit/SKNode/zRotation) properties are animated along the provided path. The duration of the action is determined by the length of the path and the speed of the node.

This action is reversible; the resulting action creates a reversed path and then follows it, with the same speed.

---

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)