Print is not making words appear in console

I Need Help with this.
I have followed the video EXACTLY, but i am not getting anything in the console. Not even a 1.
I am running Unity 4.7.2
Code:
https://pastebin.com/1vHaEbve

Unity
Before running

After Running

Number Wizard in Inspector

2 Likes

I noticed you don’t have a scene file saved… that one with the .unity
extension… See if that makes a difference. I’m thinking it may be
required to have that for the script to hook in to.

Thanks for response but i do,

1 Like

Try using Debug.Log();

Like This.

void Start(){
    Debug.Log("Welcome to Number Wizard");
}

Thanks for trying but it also did not work

You are missing a closing bracket for the class.

Oh, looks like you are just slightly scrolled to the right, my bad…

.zip up the project and upload it to a post here, lets take a look and get you moving forwards again :slight_smile:

Number Wizard.zip (135.6 KB)

1 Like

Hi,

The .zip file project is a little different from your screenshots.

When I opened your project I double–clicked on the scene, the NumberWizard game object was displayed beneath that in the Hierarchy. Your screenshot isn’t displaying the scene above the game object, however, that may just be a difference between our versions of Unity, so lets not worry about that too much.

You have two script components on the NumberWizard game object, but both are missing the reference to the actual script.

As such, no code is being called when you run the game.

So, lets fix it…

With your project open;

  • Double-click on the Main scene under the Assets folder
  • Click on the NumberWizard game object within the Hierarchy
  • Within the Inspector, click on the cog icon on the right hand side of the bottom script component
  • Select Remove Component
  • Within the remaining script component, click on the small circle icon next to the “Missing (Mono Script)” text
  • Within the new window, double-click on the Scripts folder
  • Select the NumberWizard.cs file
  • Run the game

Hope this helps. :slight_smile:

3 Likes

Perfect, Thank you!

2 Likes

No problem :slight_smile:

2 Likes

Thanks, Rob for the solution. And, thank you Dozeon for posting the question.

I had the “Display 1 No cameras rendering” happen as well with no output in the Console but, my error was due to an entirely different reason! I was busy watching Ben’s method of adding a script. :slight_smile: I was shown a drag and drop method underneath “Add Component” in a precursor course I was taking and simply forgot to add my script! I need to pay better attention.

While it probably wasn’t necessary, since we were only concerned about the console output in this lesson, I fixed the “Display 1 No cameras rendering” that was being displayed when the game was started. I added a new Camera in the Hierarchy workspace and dragged it so it was under Main but above NumberWizard.

I am glad this question was posted and solutions offered, though the issue was different from my issue, I was able to spot the issue and I could fix my problem!

1 Like

Hi Morgaine,

… and simply forgot to add my script!

It happens a lot, you only have to search the forums to see, so spotting this now is great as it will mean, hopefully, it’s something you will remember going forwards :slight_smile:

While it probably wasn’t necessary, since we were only concerned about the console output in this lesson, I fixed the “Display 1 No cameras rendering” that was being displayed when the game was started. I added a new Camera in the Hierarchy workspace and dragged it so it was under Main but above NumberWizard.

Fantastic! As you rightly stated, the camera wasn’t needed for the console output, but having it there in this case really doesn’t hurt and you resolved the error :slight_smile:

1 Like

A post was split to a new topic: My script doesn’t appear within the assets folder?

Privacy & Terms