Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    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,589
  3. Tomer-Barkan

    Tomer-Barkan

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

    Thanks!