I implemented 3DTouch actions for viewing and pop-ups in my game.
In fact, I have MenuSceneand GameScene. As MenuSceneI have 2 CollectionViewControllers(selection of the world and the level of your choice). I can use peek and pop from the world selection menu to get a preview of the level selection menu. Everything works fine, but I have 1 problem.
When I use peek and pop in MenuScene, and then turn on GameSceneto play my game, the physics seems to get messed up. The momentum of the application is very low, so my player only jumps to 1/5 of the height to which he must.
Even an increase in momentum to adapt to this scenario does not work, the jump height always remains unchanged, it does not matter what value I use.
It also seems that applyForcewhich I use with the main movement to move my player is slower.
What is strange is that this only affects jumping. My shooting code, which also uses momentum, is still working fine.
It looks like the player got heavier when I used “look” and “pop” in the menu scene, but I don't see anything that would indicate this.
If MenuSceneI don’t use peek and pop and just turn to GameScene, I don’t have this problem, everything behaves as usual.
The steps that I have tried so far to no avail.
Attempt to unregister delegate for preview on exit MenuScene.
unregisterForPreviewing(withContext: ...)
Adding a delegate to preview directly in the world menu CollectionViewControllerinstead of adding it to r ootviewcontroller.
GameScene, , -.
- ? SpriteKit?