Everything after GameObject. gets marked as wrong c#

Hello i just started to work and every Script what uses GameObject is wrong now.





You did an awful lot of work for someone who just started to work!

The complete error message contains everything you need to know to fix the error yourself.

The important parts of the error message are:

  • the description of the error itself (google this; you are NEVER the first one!)
  • the file it occurred in (critical!)
  • the line number and character position (the two numbers in parentheses)
  • also possibly useful is the stack trace (all the lines of text in the lower console window)

Always start with the FIRST error in the console window, as sometimes that error causes or compounds some or all of the subsequent errors. Often the error will be immediately prior to the indicated line, so make sure to check there as well.

Look in the documentation. Every API you attempt to use is probably documented somewhere. Are you using it correctly? Are you spelling it correctly? Are you structuring the syntax correctly? Look for examples!

All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.

Instead of keying in a massive system all at once, start with one step at a time, like this guy:

Imphenzia: How Did I Learn To Make Games:

Are you sure you didn’t accidentally declare your own type of “GameObject”?

If you had

public class GameObject{}

somewhere in your project, you would get those errors.

2 Likes

Thank you was the class thing. Those screenshots was of a Asset so i havent done this myself.