0

I'm developing a game with gameplaykit, I'm trying to increase the game speed with worldNode.speed = 4.0.

The animations are faster but the agent (GKAgent) with a certain behavior does not increase speed to move in certain point.

How can I do this?

Thanks

Simone Pistecchia
  • 2,746
  • 3
  • 18
  • 30

1 Answers1

0

I post my solution, a simple trick that works:

override func update(currentTime: CFTimeInterval) {

        if worldNode.paused { return }

        guard entityManagerGame != nil else { return }

        let deltaTimeForSpeed = CFTimeInterval(deltaTime * Double(worldNode.speed))
        entityManagerGame.update(deltaTimeForSpeed)
}
Simone Pistecchia
  • 2,746
  • 3
  • 18
  • 30