I'm trying to make a ball, SKSpriteNode, move in ALL directions including diagonals and all other directions. UIGesture doesn't work with it so I need to use UIPanGesture but I have no idea how to implement it into a SpriteKit file. This is what I have so far. Any help?? The ball sprite node is called "ball".
func handlePan(recognizer:UIPanGestureRecognizer) {
let translation = recognizer.translation(in: self.view)
if let view = recognizer.view {
view.center = CGPoint(x:view.center.x + translation.x,
y:view.center.y + translation.y)
}
recognizer.setTranslation(CGPoint.zero, in: self.view)
}