Hi everyone,
I’m new to Cocos and still in the learning process and trying to create a transition between two scenes, but I couldn’t figure out how to keep the leaving scene active until the new scene complete its transition.
It looks like loadScene
is the only available method to load new scenes, and it’s removing the current scene instantly.
So my question is, there’s any other way to load scenes that also allow creating transitions?
Thanks
Thanks @slackmoehrle but I’ve already checked that post, in fact, I checked all posts related to that subject and couldn’t find an answer.
I’m using TypeScript and what I’m looking to achieve is a transition when the current scene remains active and the new scene will slide-in above it, something similar to this animation
I’m having the same issue-- there does not seem to be a cc.director pushscene or popscene any more, only loadscene, which does an immediate replacement so it is not possible to display two scenes at the same time, so you cannot do any transitions.
This seems to defeat the whole purpose of having scenes though-- these days transitions are expected in most games. The only way to do it seems to be to make every ‘scene’ a prefab, and only use 1 scene for the entire game.
@LiadIdan May be you can grab last frame from previous scene and use a persist node to make animation after you loaded the next scene. It may not be so easy but you may screenshot the last scene or if structure is not too complicated you may copy visual content to a persist node and load other scene.
Here is a short video shows how to use persist nodes in case you want to check:
Thanks @FocusCreative, I got the same suggestion in the issue that I’ve opened in the GitHub repo. The problem is, except for being a hackish solution, it also won’t work well for scenes that contain animations, since the animations in the leaving scene will appear frozen.
It may be still a bit hackish but you may add all root nodes in your current scene into the persist node and keep it animating until slide out from the screen or covered by the new scene?