Search Issue Tracker

Fixed in 2021.1.X

Fixed in 2018.4.X, 2019.4.X, 2020.1.X, 2020.2.X



Found in



Issue ID




[SerializedField] fields produce "Field is never assigned to..." warning



1. Open the attached project (
2. Observe the warning in the console

Expected: field with SerializeField attribute do not produce the warning

Reproduced in 2018.3.0a1, 2018.3.0b1, 2018.3.0b2, 2019.1.0a1
Did not reproduce in 2018.2.8f1
Regression introduced in 2018.3.0a1

  1. lukaszunity

    Nov 06, 2019

    #pragma warning disable 0649
    // your code
    #pragma warning restore 0649

    Or disable it globally by adding a file named csc.rsp to the root of you Assets folder, e.g. Assets/csc.rsp, with the following contents without quotes.


    This will tell the C# compiler to not emit a warning for CS0649 / unused fields.

    If you have .asmdefs with csc.rsp in your project, then you also need to add the "/nowarn:0649" line to those csc.rsp files.

  1. Resolution Note (fix version 2021.1):

    A list where you can pass additional compiler arguments as well as a toggle to suppress common warnings is added in the Player Settings
    Fixed in 2021.1.0a2

  2. Resolution Note (fix version 2020.2):

    Fixed in 2020.2.0b9

  3. Resolution Note (fix version 2020.1):

    Fixed in 2020.1.11f1

  4. Resolution Note (fix version 2019.4):

    Fixed in 2019.4.15f1

  5. Resolution Note (fix version 2018.4):

    Fixed in 2018.4.29f1

Comments (84)

  1. Toxast

    Nov 06, 2019 08:46

    Before this "design" I was able to see real issues in the console.

  2. mayofunk

    Oct 10, 2019 14:47


  3. LeFlown

    Oct 10, 2019 14:44

    I agree with everyone here. This needs to be adressed, please.

  4. michaelday008

    Oct 09, 2019 07:43

    You guys only have 100 warnings? I have about 340 of these because I use a lot of serialized attributes over about 200 .cs files. I'm not going to go through 200 scripts and add pragmas to them...

    Setting default Values is NOT a solution because I have had multiple instances where somehow a default value overrode the value I set in the inspector, and I had to go remove the default values from 100 objects to prevent values I specifically set from disappearing!!!

    I'm not sure when it happens (maybe I clicked revert accidentally or something), but whatever the case it causes hours of headaches when it does occur and there is literally NO warning telling you that a bunch of serialized attributes you set on a hundred objects are about to be reset to defaults and override your values.

  5. karolwieczorek9

    Oct 08, 2019 13:44

    Is there any chance to reopen this? really annoying bug

  6. transat

    Oct 08, 2019 04:30

    Using Unity's own preview Standard Assets Controller, I get 120+ issues in my console because of this. Surely there has to be a better solution than just saying "by design"?

  7. ShadowOfEclipse

    Oct 06, 2019 22:34

    Agreed that this should be re-investigated.

  8. JillCrungus

    Sep 26, 2019 16:33

    This is blatantly NOT intended functionality and the proposed solutions are just workarounds for a bug that should not have been marked resolved.

  9. Jokerminator

    Sep 23, 2019 19:58

    Damn this is bugging!

  10. sabras

    Sep 23, 2019 14:18

    Please reopen, its really annoying

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.