I have a problem in my game and i am trying to find out what it is and it is about the position of a SKSpriteNode
and i made a SKLabelNode
to display the position so i could see what is going wrong. I did:
testlable.text = "\(leftObstacle.position)"
testlable.zPosition = 50
testlable.fontSize = 60
It displays the position of (00,00)
when it is in the top left corner or outside of the screen not ever the right position and it isn't ever at (00,00)
so what should i do to make it display the right position?
The position parameter is the position of a node relative to its parent node - so if leftObstacle is a child of another node in the scene that would explain why it always looks like it is at 0,0. In this case report the position of its parent (or its grand-parent etc.) to get what you need.