How to properly pause a game

I was working in cocos2d-x 3.2 and was using pausedSet = this->getScheduler()->pauseAllTargets(); to pause the game and this->getScheduler()->resumeTargets(pausedSet); to resume the game. I’ve updated to cocos2d-x 3.6 and this method doesn’t work anymore. Instead of pausing the sprites movement and pausing the selectors, it just pauses the selectors. If anyone has an alternative method of pausing the game that’d be great.

This post helped me and ended up working for me. Check it out