- Home /
Common way to make a GameTutorial?
Hey there! As the title says I want to make a "Instruction" or "Tutorial" when the game begins, but I am not quite sure how to do this. Is there a common way? Should I use just animations, just scripts?
I know the question is not very precise, feel free to ask me any further information! Thank you in advance!
Is it a puzzle game, a $$anonymous$$$$anonymous$$ORPG, a fps? $$anonymous$$ost likely you can get away with some tutorial scripts mainly using GUI instructions and movements of the GUI rects. Those scripts are added to the needed level (first one), and then you can add them to the level when something new appears. Then they would be triggered by a condition, like this would be on a new item:
public Tutorial tutorial;
void Start(){
tutorial.enabled = false
}
void OnTriggerEnter(Collider col){
tutorial.enabled = true;
}
public class Tutorial:$$anonymous$$onoBehaviour{
string instructions = "Here is a new thing";
void OnGUI(){
GUI.Box(new Rect(), instructions);
if(GUI.Button(new Rect(),"Ok")){
Destroy(this);
}
}
}
Thank you for your effort, it is a 2D sidescroller and this should not happen when the player hits a certain object. In the $$anonymous$$ain$$anonymous$$enu is a button called instructions, then I want to have a videolike sequence that is able to interact with the players Input. And maybe to make things clear: I am not new to Unity, I just don't want to reinvent the wheel!
Answer by Hachley · May 10, 2014 at 03:55 PM
You could check the old flash games. I remember the early 2000's when the flash game spree was on the height, almost every game had the Instructions button under the Play. Though the instructions varied, most had images along with text telling how to play. I suggest just to think of the easiest way of telling people how to play without a lot of text.
That's one of the ideas I had, thank you for mentioning, but I thought of something more interactive, like: Now pres jump to jump, then press: Double Jump to make an extra Jump.
I am just wondering if I should use the real Player prefab or not. And I want to stop the whole instruction while waiting for the input. If I use Time.TimeScale = 0, does unity still get the inputs?
I'm not sure about input with Time.TimeScale at zero, but I personally would just create another Player prefab script and scene designed for the tutorial level only, and just pause the needed things separately.
Input still runs while timeScale is at 0.
One way to do it without modifying the timeScale is to use a State:
void Update(){
if (state == State.Tutorial){
StopAnimation();
return;
}
}
This is a simplified version of it.
Ah and by the way, the instruction Scene is a different than the game scene, is this a common way? So I won't need any states.