Ok, so I tried to position the line on my iPhone 6s + and my iPad 2. The line was added to SKCamera (I don't know if this affects 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 that position x is 0.0 on the right? Here's what it looks like on my iPhone 6s +:
As you can see, the line is in the middle?
Here's what it looks like on my iPad 2:

I just don’t understand why the line position is completely different. Please help me!
source
share