Creates an action that moves the node at a specified speed along a path.
SDKs
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
Framework
- Sprite
Kit
Declaration
Parameters
path
A path to follow.
offset
If
true
, the points in the path are relative offsets to the node’s starting position. Iffalse
, the points in the node are absolute coordinate values.orient
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
and z
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.