1
\$\begingroup\$

I want to know how to show tutorial when player playing for First time. Only once

\$\endgroup\$
  • 1
    \$\begingroup\$ This would involve saving some information in your saved game or player prefs when you've shown your tutorial for the first time. When you want to show the tutorial, you check that saved data - if you already wrote the "I've finished showing the tutorial" message there, then you can skip displaying it this time. How have you tried implementing this so far, and where did you get stuck? \$\endgroup\$ – DMGregory Apr 3 at 17:24
1
\$\begingroup\$

You can use the class PlayerPrefs to store persistent data on the user's device.

In order to decide whether or not to play the tutorial, find out if the player already completed the tutorial with

if (PlayerPrefs.GetInt("Tutorial_Completed") == 1) {

After the player completed the tutorial, set the variable with:

PlayerPrefs.SetInt("Tutorial_Completed", 1);
PlayerPrefs.Save();
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ made a ui just it is like image it should come when user is playing for first time how should i give the setint getint values \$\endgroup\$ – Mustafa Ahmed Apr 5 at 13:32
  • \$\begingroup\$ @MustafaAhmed If your tutorial is all in one GameObject, then I would recommend to put that in the Start method and use SetActive(false); to deactivate it immediately on a second playthrough. But that really depends on how exactly you implemented your tutorial. There is never just one way to do something in Unity. If you want more specific answers, you need to provide more information in your question. \$\endgroup\$ – Philipp Apr 5 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.