- Home /
Change of Scenes
Hello,
I would like to make a text(New Game) change to a new scene. My scene I would like it to send me too is called Character Generation. What would be a script to be able to do this. I don't mind Java Script of C#... Although most of my scripts are C#, I would just like to know the script and how to apply it. Also if you don't mind can you put in there a way for me to make it fade black then fade into the new scene. Thanks! Oh and could you tell me which type of script your using?
Answer by Daniel-Everland · Nov 11, 2012 at 05:51 PM
As far as I understand you want a script that changes the scene of your game, correct? If so then it's pretty easy.
First make sure that both scenes are in your build (Go to File > Build Settings... > and then drag and drop your scenes into the top box).
Then open your script and use the following statement.
Application.LoadLevel("NameOfYourScene");
Hope this helped :)
Thanks. Is this Java script or C#? and is there a way to amke one scene fade into the next?
I did what you said and I have a prob... You see I want to make it so that when I click the text that says, New Game... That it takes me to the scene "Charcatcer Generation" Now what's happening though is that it sends me directly to thsi scene. I don't want this. Did I do something wrong or is there a different script I need?
You need to but the statement inside the proper method. So your script might look like this:
using UnityEngine; using System.Collections;
public class Start$$anonymous$$enuScript : $$anonymous$$onoBehaviour {
void On$$anonymous$$ouseDown() { Application.LoadLevel("NameOfYourLevel); }
And then you attach that script to the text you have.
Your answer
![](https://koobas.hobune.stream/wayback/20220613083657im_/https://answers.unity.com/themes/thub/images/avi.jpg)