What is this and how can I solve it?
Assets\AdventureGame.cs(9,28): warning CS0649: Field ‘AdventureGame.startingState’ is never assigned to, and will always have its default value null
What is this and how can I solve it?
Assets\AdventureGame.cs(9,28): warning CS0649: Field ‘AdventureGame.startingState’ is never assigned to, and will always have its default value null
Hi,
The message is harmless. It’s probably triggered by a bug in Unity. Double click on the message. A line in your code should get highlighted. Add = default;
behind the variable name as you did in line 8 of AdventureGame.
Did this fix it?
the = default; code didin’t work
What exactly did you write? Could you share the relevant code part?
See also:
To remove the warning I find that making the variable = null, works. In the end its only a warning won’t affect the game .
ok
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.