Search Unity

The field X is assigned but its value is never used

Discussion in 'Scripting' started by Nanako, Feb 1, 2015.

  1. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    ugh i hate this debug message. It just spams up the console and annoys me. I plan out my code carefully in advance, i implement things a piece at a time. this message always comes from half-implemented code and i find it frustrating.

    is there any way to just turn it off? I still want to see other warnings, just not this one. If i want to optimise out unused variables i'd rather do that once, near the end of the development cycle.
     
  2. willemsenzo

    willemsenzo

    Joined:
    Nov 15, 2012
    Posts:
    585
    If you don't use it yet, comment it out.
     
  3. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    i don't read it, but i do write to it in many cases. populate things with values i'll use later once i implement the system that needs them. Commenting it out often requires poking through the code and commenting 3-5 lines for each variable. it gets messy.
     
  4. Oana

    Oana

    Joined:
    Sep 28, 2012
    Posts:
    87