Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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,650
  3. Tomer-Barkan

    Tomer-Barkan

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

    Thanks!