LevelManager script doesn't display message in Console

I am following this course using Unity Version 4.7.2fl. I am unable to get the log to display the message as programmed in MonoDevelop. I am unsure as to what the issue is, but have noticed some differences between the display in the video, and what I see on my version of Unity and MonoDevelop.

In the above screenshot, I saw two things that concerned me, and was wondering whether there are any configuration issues that are causing this discrepancy. First off, you can see that the top bar shows a path to the script file, and not a declaration of “Assembly C-Sharp”. Is this a version difference, or do I need to change my preferences?

Also, when I opened the Solutions sidebar, It shows Assembly C-Sharp as a subset of Text101, which was the previous project. I didn’t do anything that I’m aware of to link the two projects together, so am confused as to why this is showing.

Additionally, when I tried to type in “Debug” into the code, when the AutoComplete bubble appeared Debug was not one of the possible options. This again is confusing to me:

In Unity, I believe I have linked the OnClick event to the correct script. Despite this, I am still unable to get the log to show in the console when I click on the Start Button:

Any advice or comments would be greatly appreciated. Thanks!

1 Like

Hello Mark,

When you open the script files, are you opening them from the local directory directly, or are you double-clicking on the script from the Assets folder within Unity?

1 Like

Hey Rob,

In answer to your question, my effort was to follow the instructions in the video as closely as possible. I double-clicked on the script from the Assets folder.

On another note, I noticed another issue involving the position of the script. I followed the instructions to reset the position to zero, but when I did the following error message appeared on my console:

  1. What does ArgumentOutOfRangeException mean?
  2. Why is it showing up on my console when I try to move the script to position 0?
  3. Could this be related to the logs not showing up in the console?

Thanks

1 Like

Hi Mark,

When you say “position of the script” what are you referring to?

1 Like

Hi Rob,

About 2 minutes into the video for Section 4, Lecture 47, there is a discussion that any objects that are only there to provide scripting logic be positioned at the 0 position on the canvas as a matter of convention.

Mark, would you mind sending a print of the text inspector?

1 Like

Sure Joao,

Below are screenshots of the text inspectors for both the Start and Quit buttons.

2 Likes

Thanks Mark,
Did you dragged the levelmanager from the hierarchy to the inspector? It has to be instantiated in order to run the code, if you drag the levelmanager from the asset it may not work.

Hi Joao,

I dragged LevelManager from the hierarchy, as was instructed in the video.

As an experiment, I just now tried dragging it from the Asset folder to the inspector to see what would happen, and when I did the LevelManager functions were not available from the dropdown menu. So I understand your point…

Is it possible that the installation of Unity is corrupted? Should I try reinstalling it?

2 Likes

I wouldn’t go as far as that initially. I would try to detach / remove items until the errors are all cleared. Then add things back again one at a time until you spot the errors and thus the source of the problem.

Another thing you could try is creating a new empty project in Unity. Create an empty game object, and a simple script that just logs to the console from within the Start() method… see whether that works/errors.

1 Like

Hi Rob,

Will try, Thanks.

1 Like

Sorry I didn’t reply sooner, was sorting my lad out…

It’s obviously difficult for us to resolve some issues remotely without seeing the whole picture… but if you can start a new project, one scene, one game object, one script with something like;

void Start()
{
    Debug.Log("No errors here!");
}

…then, assuming there are no errors I think we can rule out Unity being the issue, thus, no tedious reinstall :slight_smile:

So, let us know how you go with that, and if that isn’t your entire script in the first post of this thread, please post the entire script. Also, screen shots of the whole Unity window would be handy so we can see what’s in the hierarchy/project/inspector etc… always handy, but one thing at a time :slight_smile:

1 Like

No worries on the timing, as it is I am very impressed with your attention and directions. It is genuinely appreciated.

As for the test, I will try your suggestion and report my findings. The script I submitted was not the final one. I totally get your logic and will be sure to follow that format moving forward.

2 Likes

You’re more than welcome - great community here with lots of people always willing to help others out.

I will wait to hear back from you regarding the test above. :slight_smile:

1 Like

Hey, still trying to understand what is the problem with this script =/

Have you restarted the computer since this problem has started? The one thing strange so far that I have seen was the Text101 on the solution, perhaps it is worth deleting the levelmanager from the project, reinstalling and recreating it inside the number wizard project.