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

# follow(_:speed:)

Creates an action that moves the node along a relative path at a specified speed, orienting the node to the path.

```
class func follow(_ path: CGPath, speed: CGFloat) -> SKAction
```

## Parameters

`path`

A Core Graphics path whose coordinates are relative to the node’s current position.

`speed`

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

## Return Value

A new action object.

## Discussion

Calling this method is equivalent to calling the [`follow(_:asOffset:orientToPath:speed:)`](/documentation/SpriteKit/SKAction/follow(_:asOffset:orientToPath:speed:)) method, passing in <doc://com.apple.documentation/documentation/Swift/true> to both the `offset` and `orient` parameters.

This action is reversible; the resulting action creates and then follows a reversed path 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)