Problem with displaying text

Hi guys! So, I’m doing some Unity practice before I return to college and I was just working with music and having text that shows the song name and pitch. I have the song name and the pitch (which can be changed with two in-game buttons) visible for one of the songs (‘My Shot’) but it doesn’t work for the other one (‘Wait For It’, yes I’m Hamilton trash), the name appears fine, but the pitch only briefly flashes onscreen. If anyone could help with this I would appreciate it! Here are the two scripts that it’s handled in:

Switching songs:

void Start () {
        myShot = true;
        waitForIt = false;
	}

    void Update()
    {
        if (myShot == true)
        {
            //main.Pause();
            main.clip = Shot;
            myShot = false;
        }
        if (waitForIt == true)
        {
            //main.Pause();
                main.clip = Wait;
                main.Play();
                waitForIt = false;
            }
        }
	// Update is called once per frame
	void OnTriggerEnter2D (Collider2D other) {
		if(other.tag == "Song")
        {
                myShot = false;
                waitForIt = true;
            }
        }
}

Text stuff:

void Start()
    {
        pitch = main.pitch;
    }

    void Update()
    {
        songText.text = song + " " + "Pitch:" + pitch;
        pitch = main.pitch;
        if (SongSwitch.myShot == true)
        {
            song = "My Shot";
        }
        if (SongSwitch.waitForIt == true)
        {
            song = "Wait For It";
        }
    }
}

Like hexagonius said, your text is probably too long for the Text element to display properly. To check that, select your text object, find the Horizontal Overflow field in the Inspector (it should be set to Wrap) and set it to Overflow. You will see that even if the text is too long, it will be displayed outside of the text area. You might also want to change the Vertical Overflow, if needed.

The second problem is the way you are displaying the pitch value. It is a float value, so when you simply add it to the string, it displays it precisely, down to several decimal places. Depending on the value of the pitch field, the decimal places number might change, causing the text to flicker if it can’t fit in the box. You might want to control the number of decimal places yourself. Instead of "Pitch:" + pitch; try using "Pitch:" + pitch.ToString("F2");. That will limit the amount of decimals to 2.