error CS0246: The type or namespace name 'transform' could not be found

Edit: I ended up figuring this out about 5 minutes after I posted this. It turns out I didn’t have a capital letter. I don’t know how to delete threads so this is here still… sorry.

public Transform teleportTarget; // when it’s the type, it’s capitalized.
thePlayer.transform.position // when it’s an instance of that type, it’s lower-case.
Notice how it’s after thePlayer and the dot…so it’s a property of that gameObject.

Does not apply to primitive types: int, float, bool, string. Always lower-case.

I’m sure I’m oversimplifying things and there probably are exceptions (?), but that’s the gist.

Sweet! For future reference, remember: NOBODY memorizes error codes. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.

The important parts of an 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)

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.

How to understand compiler and other errors and even fix them yourself:

https://discussions.unity.com/t/824586/8