I am trying to move a SKShapeNode along a UIBezierPath. Here is the code I have so far:
// Set up the circle track
let circleTrack = UIBezierPath(roundedRect: CGRectMake(screenWidth/2, screenHeight/2, screenWidth/3, screenWidth/3), cornerRadius: 100)
let shapeTrack = SKShapeNode(path: circleTrack.CGPath, centered: true)
shapeTrack.position = CGPointMake(screenWidth/2, screenHeight/2)
shapeTrack.strokeColor = SKColor.whiteColor()
self.addChild(shapeTrack)
// Create the ball
let circle = SKShapeNode(circleOfRadius: 15)
circle.position = CGPointMake(screenWidth/2, screenHeight/2)
circle.fillColor = SKColor.whiteColor()
self.addChild(circle)
//Move the circle
circle.runAction(SKAction.repeatActionForever(SKAction.followPath(circleTrack.CGPath, speed: 3.0)))
All the action does is make the shape node disappear. How can I get it so that the circle moves along the bezier path forever?