I am trying to make it so when I click a 3d text at the end of the game, it resets the scene. How can I do this?
1 Answer
1- Write a script for your 3D Text.
- Add a collider
The first thing that you must do is write a simple script for your 3D Text. Remember, do not confuse OnMouseDown with Update. I did that once, and it was worrying until I worked out why my level instantly changed to another.
The number of your level is found under File, then Build Settings. You could also, in the same space, put the name of your level in speech marks.
function OnMouseDown ()
{
Application.LoadLevel(/* The number of the level that you want to load */);
}
Then what you need to do is add a collider, any collider. I prefer to use a box collider, personally.
That should work, but if you have any problems, please tell me.
Call Application.LoadLevel(Application.loadedLevel) on clicking the 3D text.
– HarshadKBy reset, do you mean completely reload the level, or something more like put the actors back at their starting place, but keep the score?
– screenname_takenReload the level
– netherboss123Then it's what @Harshadk said.
– screenname_takenAttach this script to your 3D text function OnMouseDown() { Application.LoadLevel("yourscenename"); //or you can use Application.loadedLevel; } //add collider in your 3d text
– Jeric-Miana