Getting error CS1061 - Please help

hi guys , im making a hangman game but get 1 last error which is CS1061 the following pastebin link is my code , can anyone help me out please? Thanks

Thanks for your time.

The compiler will tell you the exact line that has the problem. Look for two numbers inside round brackets. You need the first of these numbers. This is the line with the problem. Next time you need help, it’ll make it far easier to help you if give the line number, or comment you code with something that says //<---- error here. If you are feeling daring, you could always double-click the error in Unity and Unity will open MonoDevelop and drop the cursor onto the line that has the problem. This is the way the rest of us solve these kinds of problems.

Anyway, because I am a decent helpful chap, I just copied and pasted your code into my Unity project. I got the following, which, is exactly what I expect you’ll get:

Assets/Hangman.cs(32,33): error CS0103: The name `checkChar' does not exist in the current context
(Filename: Assets/Hangman.cs Line: 32)
Assets/Hangman.cs(47,47): error CS0122: `string.length' is inaccessible due to its protection level
(Filename: Assets/Hangman.cs Line: 47)
Assets/Hangman.cs(53,47): error CS0103: The name `guessedWord' does not exist in the current context
(Filename: Assets/Hangman.cs Line: 53)
Error: Analytics Event: 5(Compiler*error CS0103*The name `guessedWord' does not exist in the current context)(1): skipped because it was sent more than once in 0.10 seconds
Assets/Hangman.cs(54,69): error CS0103: The name `guessedWord' does not exist in the current context
(Filename: Assets/Hangman.cs Line: 54)
Error: Analytics Event: 5(Compiler*error CS0103*The name `guessedWord' does not exist in the current context)(1): skipped because it was sent more than once in 0.10 seconds
Assets/Hangman.cs(54,33): error CS0103: The name `guessedWord' does not exist in the current context
(Filename: Assets/Hangman.cs Line: 54)

So now I know the lines numbers you did not mention. So, I can now tell:

  • Line 32 - you can used checkChar() when your function is called CheckChar().
  • Line 47 - you have an assignment to x where you probably mean a < character.
  • Line 53 - guessedWord should have a lowercase w.
  • Line 54 - same as line 53

So, you now know how to troubleshoot these errors for yourself, and I’ve given you solutions to your problems.