[Solved] My NumberWizard project won't play and run, and now any new project won't run any script

I made the Number Wizard project work, but when I came back to it later, i found that not only was it unable to “play”, but it couldn’t play any scripts at all. I tried making a new project “New Unity Project 2”, made a scene called “Angry Room” to test if it was a project-based problem, but the new YellingProgram won’t play.

This is the script:

If I can solve the problem for the New Unity Project 2 (test room), I should be able to solve it for Number Wizard, and all of my future projects.

Expected:
For the console to show “AAAAAAAAAAARUGGH” when I press play.

Observed
Nothing happening when the project starts playing.
This problem continues with other projects, stopping me from continuing.
A Blue Screen on the video.

In your Hierarchy you only have one Game Object which is the Main Camera.

In order for your script to execute it needs to be attached as a component of a Game Object. Assuming it isn’t attached to your Main Camera, create a new empty Game Object, and attached your script to it (by dragging it onto the Game Object in the Hierarchy), then run the game again.

Hope this helps. :slight_smile:

p.s. the blue screen is the colour which has been set for the camera, if you click on the Main Camera, view it’s details in the Inspector, you will note the blue colour :slight_smile:

Thanks! That explains it!

Now I’ve added the number wizard script to the object multiple times, and after deleting the Yelling Program script, it now has this problem:


Is there a way to access the object and fix this (get rid of one extra copy of the NumberWizard script, erase the memory of the Yelling Program)?

Hi Luc,

The script should only be added once, if you have it more than once on a GameObject you can remove the additional components using the controls on the right hand side of each component whilst viewing the GameObject in the Inspector.

Regarding the problem you say you are now experiencing, can you explain a little further as I am uncertain as to what the problem actually is from your screenshot. Thanks. :slight_smile:

I forgot about the inspector tab: thank you!
I’ve solved it, but wanted to show you the error while it was still there:

I think that the object was looking for the YellingProgram script I deleted, and the error was from it being gone. I (think) I deleted the function that looked for the missing script.

Current Version:

The Number Wizard Program works again, and I’m ready to go to the next lesson now. Thanks!

Aha! Yes, that would do it. If you gave a script component but then delete, or indeed rename, the script you will have this issue.

Glad to hear you have resolved it and can move forward again. Enjoy the rest of the course :slight_smile:

1 Like

8 posts were split to a new topic: [Solved] Can’t see basket balls or cube?

Privacy & Terms