MonoDevelop changes text into Text [SOLVED]

Hello. I’m trying to complete Lecture 30 and MonoDevelop is being “smart” by converting “text” into “Text”. Here’s the relevant code:

void Start () {
	Text.text = "Hello world";  
}

What’s going on, and is this why the instructor of “Learn Python the Hard Way” recommends that you don’t use an IDE? Thanks for your help.

Hi @Jorin_Gedamke,

Can you post the whole script please.

There’s no issue using an IDE, that sounds a little bit like bravado to me.

Sure, here’s the script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class TextConroller : MonoBehaviour {
	public Text text

	void Start () {
		Text.text = "Hello world";  
	}
	

	void Update () {
		
	}
}

Sorry; that last curly brace wasn’t copied into the “code” tags.

1 Like

Ok, so the issue is the missing semi-colon on the end of this line;

public Text text

Also, you are missing a “t” from the word “controller” in the class name TextController. Unity expects the class name and the filename of the script to match, so this one is quite important.

Hope this helps :slight_smile:


See also;

Thanks, Rob! You just saved me hours of frustration. :smiley_cat: (I love cats; can you tell?)

Well, huh. I not only skipped that “t” in the script, but the file name as well. Oops.

1 Like

hehe, you’re very welcome.

Anything else, just post :slight_smile:

Privacy & Terms