I have run into this strange issue. I am adding an enemy(SKSpriteNode) from inside the GameScene didMove(to view: SKView) using addChild.
The enemy has been positioned to x:100, y: 100 and it appears correctly.
I also have another animation , the completion of which I am adding another enemy at the same location . But the enemy appears at a different location.The completion block is as shown below.
holeExplosion.runHoleExplosionAction {[unowned self] in
//self.addEnemy(enemyCount: 1, hole: holeExplosion)
var modEnemy: ParentEnemy? = nil
modEnemy = Enemy1(imageNamed: "Zombie1Jump1.png", healthPower:30)
print(" \(self.scene?.position.x) \(self.scene?.parent) ")
self.addChild(modEnemy!)
modEnemy!.enemySpeed = self.enemy1Speed
modEnemy!.name = "enemy1"
modEnemy!.position = CGPoint (x: 100 , y: 100)
modEnemy!.zPosition = 2
}
Any help would be appreciated. Thanks.