Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

strange error

Discussion in '2D' started by ijneb612, Jul 31, 2022.

  1. ijneb612

    ijneb612

    Joined:
    Sep 23, 2021
    Posts:
    12
    ive had a strange error where it says there is no ; but there is its on line 12
    if you know the issue please reply im not sure at all how to fix it.
    pictures: Screenshot 2022-07-31 111654.png Screenshot 2022-07-31 111654.png Screenshot 2022-07-31 111634.png
     
  2. ijneb612

    ijneb612

    Joined:
    Sep 23, 2021
    Posts:
    12
    sorry about Input.MoSuePosition its fixed but the ; error is still there
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,751
    Photographs of code are NOT a thing.

    If you post a code snippet, ALWAYS USE CODE TAGS:

    How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/

    This just smells like typing mistakes to me. Prove me wrong.

    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.

    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.

    Remember: NOBODY here memorizes error codes. That's not a thing. 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.
     
  4. ijneb612

    ijneb612

    Joined:
    Sep 23, 2021
    Posts:
    12
    thanks for the help sadly its is in the top of the consolle and if its in the error code then im not sure ehy it says thers a missing ;.
     
  5. ijneb612

    ijneb612

    Joined:
    Sep 23, 2021
    Posts:
    12
    ehy = why
    miss type
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,751
    Yes, it is because of your mistyping... look closely at how you are calling the GetMousePos() method...
     
  7. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    you should use a code compiler that underlines when u make spelling mistakes
     
  8. ijneb612

    ijneb612

    Joined:
    Sep 23, 2021
    Posts:
    12
    sorry i treid that did not work :(
     
  9. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,751
    Tried what? Your code shows you NOT adding parenthesis to invoke the function!

    You call functions by their name followed by open parenthesis, then any arguments, then close parenthesis.

    Go add open/close parens after GetMousePos so you actually invoke the method.

    I would copy/paste it but you haven't posted code, you posted a photograph of code, which is not a thing. That's why we have code formatting and code tags:

    If you post a code snippet, ALWAYS USE CODE TAGS:

    How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/
     
  10. MaxwellTan

    MaxwellTan

    Unity Technologies

    Joined:
    Mar 3, 2022
    Posts:
    73
  11. ijneb612

    ijneb612

    Joined:
    Sep 23, 2021
    Posts:
    12