- Home /
show text to start playing
Hello everyone! Ive been trying to find a script to make a little text to start my game saying: "ready"then "go!" and I want the player not beeing able to move until this is shown.... any ideas?
Answer by Moon · Apr 19, 2011 at 03:40 AM
Well, if I understood right what you wanted right...Here is a GUI that will pop up at the bottom of the screen saying "Are you ready????" than a button under it saying "GO!!" and when you click the "GO!!!" button, the GUI will all go away, the problem is the character is going to move while this is up, but you might figure it out..Hope this helps :)
public var item0 : GUIContent = GUIContent("Are you ready????"); public var item1 : GUIContent = GUIContent("GO!!"); public var guiSkin : GUISkin;
function OnGUI(){
GUI.skin = guiSkin;
GUI.Box(Rect(Screen.width/2 + -400, Screen.height-70, 800, 30), item0);
if(GUI.Button(Rect(Screen.width/2 + -25, Screen.height-40, 50, 40), item1)){
Destroy (this);
}
}
function Awake() {
}
function fillWindow(winID : int) {
switch(winID){
default:
Debug.Log("Default case reached");
}
GUI.DragWindow (Rect (0,0, 10000, 10000));
}
well, actually thats what im having trouble with. I want to give the player the time to prepare himself to run because other character is chasing him :s... so its kind of delay the gameplay? i guess...
Thanks a lot though. $$anonymous$$aybe I made it sound too complicated, all i want is an animated text that goes ready, go! ... and then the game can start.
Well, you could create a scene where they cannot move and have this script in there, but replace the "Destroy (this);" with "Application.LoadLevel(LEVELID);" ....LEVELID is the id of the level for example; "1" or "2" depends on how you have all the scenes set up