Why are the positions of my nodes different on every device?

Viewed 173

Ok, so I've been trying to position a line on my iPhone 6s+ and my iPad 2. The line was added in an SKCamera (I don't know if that effects it or not). Here is the code for the line:

    var leftWall = SKSpriteNode()
    leftWall.size = CGSize(width: 1, height: 10000)
    leftWall.position = CGPoint(x: 0, y: 0)
    leftWall.color = UIColor.red
    leftWall.physicsBody = SKPhysicsBody(rectangleOf: CGSize(width: leftWall.size.width, height: leftWall.size.height))
    leftWall.physicsBody?.affectedByGravity = false
    leftWall.physicsBody?.isDynamic = false
    leftWall.physicsBody?.categoryBitMask = groundGroup
    leftWall.physicsBody?.collisionBitMask = ballGroup
    leftWall.physicsBody?.contactTestBitMask = 0
    theCamera.addChild(leftWall)

Okay, so the x position is 0,0 right? Here is how it looks on my iPhone 6s+:iPhone 6s+ As you see, the line is in the middle?

Here is how it looks on my iPad 2:

iPad 2

I just don't understand why the position of the line is completely different.. Please help me!

1 Answers
Related