# Move SKSpriteNode around

**URL:** <https://forums.kodeco.com/t/move-skspritenode-around/21735>\
**Category:** Sprite Kit\
**Created:** [October 26, 2016, 2:14pm UTC](https://forums.kodeco.com/t/move-skspritenode-around/21735 "2016-10-26T14:14:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![007fred50](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@007fred50](https://forums.kodeco.com/u/007fred50)\
**Post date:** [October 26, 2016, 2:14pm UTC](https://forums.kodeco.com/t/move-skspritenode-around/21735/1 "2016-10-26T14:14:58Z")

</div>

what i will have it to work… it move from one directory to another without jump to Z and Y

var player: SKSpriteNode?

```
override func didMove(to view: SKView) {
    
    self.anchorPoint = CGPoint(x: 0.5, y: 0.5)
    
    player = SKSpriteNode(color: UIColor.cyan, size: CGSize(width: 90, height: 90))
    player?.anchorPoint = CGPoint(x: 0.5, y: 0.5)
    player?.position = CGPoint(x: 0, y: 0)
    
    print("X: \(player?.position.x), Y: \(player?.position.y)")
    self.addChild(player!)
}

override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
    for touch in touches{
        let location = touch.location(in: self)
        
        player?.position.x = location.x
        player?.position.y = location.y
        
        print("X: \(player?.position.x), Y: \(player?.position.y)")
    }
}

```
