Search Unity

Text Adventure Game Help

Discussion in '2D' started by AMP19, Dec 7, 2018.

  1. AMP19

    AMP19

    Joined:
    Nov 27, 2018
    Posts:
    3
    So I need to make a text adventure game for a school projects using states. We briefly went over how to make a game like this, then never touched unity again for over a month and no one remember how to do anything besides Debug.Log. I already made the game in Debug.Log but i can't use that version for my final project. The game needs to have the text pop up on screen, something to select on option, and have the text change. Nobody in my class doesn't know how to do any of these and my teacher won't help us or give us refreshers on anything. I am also extremely incompetent in this class, so could answers be explained as if your talking to someone who has never used unity before.

    If it makes things any easier, what are some good templates I can use and just fill in the blanks for what I need?

    All help is appreciated .
     
  2. Thimble2600

    Thimble2600

    Joined:
    Nov 27, 2015
    Posts:
    165
    Eyy, you can create a UI Text gameobject like this.



    Add a script to some game object.

    Code (CSharp):
    1.     //someScript.cs
    2.     public Text uiText;
    3.  
    4.     private void SetText(string text)
    5.     {
    6.         uiText.text = text;
    7.     }
    Then drag the text game object to the game object with the script like shown below.



    Hope that helps.

    Since its a text-based game you might be interested in trying out TextMeshPro.



    Best of luck, text games are awesome :)
     
    Last edited: Dec 7, 2018