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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug CS0414 Warning

Discussion in 'Scripting' started by BobiTheDeveloper, Oct 6, 2022.

  1. BobiTheDeveloper

    BobiTheDeveloper

    Joined:
    Sep 28, 2022
    Posts:
    3
    So i have this error:
    error.png
    And i do not get it why it is throwing it even tho i've used the tileSize field multiple times.
    error22.png
    I'm pretty much a beginner folowing a tutorial so i have no clue how i could fix this.
     
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,150
    Don't. It's not an error. Just read what it says. "Assigned to but not used."

    You'll probably see this a lot as you work through tutorials. It is just trying to save you by saying, you created this variable, you gave it an initial value, but you're not using it. If you don't need it, delete it!

    But, as that isn't always the case, especially if you're creating variables during a tutorial but haven't written the code to use it, it's nothing to worry about.
     
  3. BobiTheDeveloper

    BobiTheDeveloper

    Joined:
    Sep 28, 2022
    Posts:
    3
    I can't start my game because all compiler error have to be fixed before i can enter playmode.
     
  4. BobiTheDeveloper

    BobiTheDeveloper

    Joined:
    Sep 28, 2022
    Posts:
    3
    I think i got it, thanks for the help!
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Errors are the red ones. These must be fixed.

    The yellow ones are warnings. These sometimes should be fixed. Although Unity's inspector system means you will often have a few unresolved CS0414 and CS0649 warnings that aren't meant to be resolved.