尝试将SKShapeNode与路径一起移动,但动作开始时SKShapeNode消失:
let path = UIBezierPath()
path.move(to: CGPoint(x: currX, y: currY ))
path.addLine(to: CGPoint(x: currX + 200, y: currY))
let moveAct = SKAction.follow(path.cgPath, duration: 4.0)
newNode?.run(moveAct)
试图画一条线,它显示在正确的位置
let p = SKShapeNode(path: path.cgPath)
self.addChild(p)
如果使用操作moveTo
let moveAct = SKAction.moveTo(x: 200, duration: 1.5)