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

Getting CS0649 warnings (value never assigned) for private serialized fields

Discussion in '2018.3 Beta' started by Tomer-Barkan, Oct 2, 2018.

  1. Tomer-Barkan

    Tomer-Barkan

    Joined:
    Jul 31, 2012
    Posts:
    150
    Code (CSharp):
    1.         [SerializeField] private Transform messagesParent;
    2.  
    Warning: Assets\Scripts\Flow\SystemsManager.cs(26,38): warning CS0649: Field 'SystemsManager.messagesParent' is never assigned to, and will always have its default value null

    Didn't get this warning before upgrading to 2018.3, and now my project is full of them. They also don't make sense since these values will be set in the inspector.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,467
  3. Tomer-Barkan

    Tomer-Barkan

    Joined:
    Jul 31, 2012
    Posts:
    150
    Hmm, I searched for it and didn't find a thread. Weird.

    Thanks!