1
votes

I have some issue with transitioning. Here is my standard transition code:

let transition = SKTransition.crossFade(withDuration: 1.0)
let gameScene = GameScene(size: self.size)
gameScene.scaleMode = .aspectFill
self.scene!.view?.presentScene(gameScene, transition: transition)

On the scene which I transition to I have 2 randomly spawning objects. When transitioning starts I see this nodes at one place, when transitioning finishes at other. So at the end of transition I see them dropping to other places which is incorrect behaviour.

If I put this line of code:

transition.pausesIncomingScene = false

After transition my scene just freezed and nothing happens at all!

What I can do with this transition behaviour?

1
Can you make a minimal viable product that can reproduce this behaviour and upload it to the github? I am taking that "my scene is just freezed" with doubts. I think that everything just seems to look that way, and nothing is really freezed, but rather spawning is finished and objects standing still. - Whirlwind
Where do you have your code to spawn the objects in the new scene? - TheValyreanGroup
@TheValyreanGroup I have it separate functions that I call from didMove(_ toView) just once. - wm.p1us

1 Answers

0
votes

I found place where my code works bad. when I enter GameScene I save it to my manager and when I leave this scene I save it as well to my manager. I just removed first save and now code works like a charm.

Hope this can save someone several hours.

Thank you to everyone!