Okay, so i’m trying to make a game where after the “Powered by Unity” screen, it goes to a room with a logo, plays a sound, then goes to the actual game. I’ve made both scenes and put them correctly in the build settings. I’ve also used the scripting reference to make a javascript for application.loadlevel. When I try to put it in my scene, it says “-the script files name does not match the name of the class defined in the script.” How do I fix this? And do I have to put application.loadlevel in every scene? Thanks for the help.
Do you want to share your script so we can see the problem?
Everytime you want to change the level you need to use application.loadlevel unless you design your scene to control multiple levels and handle the changing on levels manually.
I didn’t understand your problem . But maybe you’ve typed scene name wrong or there is…
//0 is scene 1 in Building Inspector
//1 is scene 2 ....
Application.LoadLevel (0);
So you can put number that’s in your Building Screen when you add a scene in it.
And if you want your level to load like after few seconds after level starts use :
//Wait for 5 secs...
yield WaitForSeconds(5);
Maybe this helps i don’t know …
-3DK
I think your mistake isn’t about the loadlevel issue, it’s about the class that you defined inside the script and the script, they both have to be saved with the same name as it says. Tell us if it worked anyway!
Fixed the error not letting me put it in the scene, and tried to use 3DK’s script, but it’s glitching. I’ll keep trying,
Ok, so I got 3DK’s script, and got it to go to the next room, but it goes way too quickly. I tried adjusting the time in the script but it doesn’t seem to work.
Hey there,
I strongly advise you to use my free Transitions Manager: Unity Asset Store - The Best Assets for Game Making
Cheers,
Pino
Also make sure you add the scenes to the build, remember the first scene added to the build (one at the top) is the one that loads by default.