The namespace EndScreen not found


I was having an error in the EndScreen section of the images above, how do I fix this?
Thanks in advance!

For that to work, you’ll need a class/script called EndScreen.

Did the instructor use it? @MichaelP

I don’t know. I think this is from the new redesigned 2d course which I haven’t done. I was just answering your question on how to fix it… or at least one way to fix it.

I’m assuming from your question you’re doing that part of the course, so shouldn’t you know whether the instructor used it?

I typically use a GameObject in this circumstance but with only this much code it’s not practical to know the intent. They may have used an EndScreen class.

Hi @Malay,

To confirm what MichaelP wrote: If you want to use a type to declare a variable, that type must exist. A type corresponds with a classname. This means that the EndScreen type exists only if you created a class named EndScreen. The C# script and the things we use in our scripts do not have anything to do with the names of game objects in the Hierarchy in the Unity Editor.

In your screenshot, I can see a script named EndScript. Maybe you wanted to use the EndScript type in your code? Gary named his script and class EndScreen.

1 Like

Oh thanks for pointing that out, that was the mistake.

Oh, sorry about that. :sweat_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms