Search code examples
iosswifttiledjstilemap

SKNodes in SKScene moving in the wrong direction


I am implementing a one dimension movement along the x axis.

The objects are moving but they are in the wrong directions

Code for moving the scene

self.obstacles.position.x -= speed // obstacles = objects
self.map.position.x -= speed // map is the scene

Solution

  • It turns out I forgot to attach my nodes to the worldCamera node.