I completed the 2D microgame platformer tutorial some time ago. At the end of the game, there’s a door that marks the scene as completed. I want to create my own scene, so that when you enter the door, the player character gets transferred to the new scene that I have created.
Your script calls SceneManager.LoadScene() with the index or name of the scene. Note that only scenes actually listed in the Build Settings will be included in your built game, and it’s those index numbers which you use for this function.
Any data that you want to carry over should be in a static object, a singleton, or in a GameObject which you have marked as “Don’t Destroy On Load,” aka DDOL, using the Object.DontDestroyOnLoad() function.
Focus on making the character moving to the new scene first. Worry about what information you may need from the former scene after that. Some items could probably just be copied from the first scene.
Find info on the ontrigger event, and the SceneManager functions mentioned above.
Assuming it has an if-statement for confirming the victoryzone is reached, you could put the SceneManager.LoadScene(scenename/sceneid here) command inside that statement.
I recommend taking some basic coding tutorials. Here’s an awesome place to start:
And for the love of all that is holy, write your code with a proper IDE like Visual Studio. Trying to code without autocomplete and error highlighting is sheer madness, especially if you’re a complete beginner. The Junior Programmer course linked above should cover this as well.