I need some help in making the player in my platform game jump. The problem I'm having is that he jumps through a pillar which he's not supposed to do (I do have the physics set up correctly). I suspect it is because of my horribly inefficient code below. I know there's a better way to move him along a path but I'm not sure how to do it.

```
var xStep = CGFloat(18)
var yStep = CGFloat(30)

var x = CGFloat(playerJump.position.x)
var y = CGFloat(playerJump.position.y)

let follow = SKAction.move(to: CGPoint(x: x, y:y), duration: 0.1)
x += xStep
y += yStep
let follow2 = SKAction.move(to: CGPoint(x: x, y:y), duration: 0.1)
x += xStep
y += yStep
let follow3 = SKAction.move(to: CGPoint(x: x, y:y), duration: 0.1)
x += xStep
y += yStep
let follow4 = SKAction.move(to: CGPoint(x: x, y:y), duration: 0.1)
x += xStep
y += yStep
let follow5 = SKAction.move(to: CGPoint(x: x, y:y), duration: 0.1)
x += xStep
y -= yStep
let follow6 = SKAction.move(to: CGPoint(x: x, y:y), duration: 0.1)
x += xStep
y -= yStep
let follow7 = SKAction.move(to: CGPoint(x: x, y:y), duration: 0.1)
x += xStep
y -= yStep
let follow8 = SKAction.move(to: CGPoint(x: x, y:y), duration: 0.1)
x += xStep
y -= yStep
let follow9 = SKAction.move(to: CGPoint(x: x, y:y), duration: 0.1)

let group = SKAction.group([
    SKAction.repeat(jumpAnimation!, count: 1),
           SKAction.sequence([follow,follow2,follow3,follow4,follow5,follow6,follow7,follow8,follow9])
])
if playerJump.parent == nil {
    addChild(playerJump)
}
playerJump.run(SKAction.sequence([group]), completion: {
    self.player.position=self.playerJump.position
    self.playerJump.removeAllActions()
    self.playerJump.removeFromParent()
    self.addChild(self.player)
})

```

Thanks in advance for any assistance.

**UPDATE**
The problem started when I increased the value in xStep. The total distance the character jumps would put it past the pillar. That's why I thought my code was an issue. Here's a video of what's happening.
[Jumping Video](http://maccrafters.com/videos/game.mov)

**UPDATE 2**
Here's my newest code which still puts the player on the other side of the pillar.

```
@objc func jumpTapped() {
    var xStep = CGFloat(18)
    let yStep = CGFloat(12)

    jumping=true
    xStep = player.xScale * xStep
    var x = player.position.x
    var y = player.position.y

    var moveAnimation = [SKAction]()

    for i in 0...8 {
        x += xStep
        if i < 5 {
            y += yStep
        } else {
            y -= yStep
        }
        let move = SKAction.move(to: CGPoint(x: x, y: y), duration: 0.1)
        moveAnimation.append(move)
    }

    let group = SKAction.group([jumpAnimation!, SKAction.sequence(moveAnimation)])

    player.physicsBody?.affectedByGravity = false
    player.removeAllActions()
    player.run(group) {
        self.endJump()
    }
}

func endJump() {
    player.removeAllActions()
    player.physicsBody?.affectedByGravity = true
    player.run(SKAction.repeatForever(self.playerAnimation!))
    jumping=false
}

```