Creates an action that moves a node horizontally.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
Framework
- Sprite
Kit
Declaration
class func moveTo(x: CGFloat, duration: Time Interval) -> SKAction
Parameters
x
The x-value for the node’s new position.
sec
The duration of the animation.
Return Value
A new action object.
Discussion
When the action executes, the node’s 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.