Search code examples
iossprite-kitsknodegameplay-kit

What is the difference between SKNode's position property and GKAgent2d's position property


SKNode has a position property which represents the node's position in parent. Whereas GKAgent2D also has a position property which according to the documentation is its position in 2D space. How are these two related? And how do we convert between each other and is a conversion necessary?


Solution

  • You can use GameplayKit without SpriteKit. The Agent's position is internal to GameplayKit and then you synchronize your sprite's position to your agent's position. It means you can also have agents with other frameworks.