Hi everyone. I’m developing a Online - Mobile game and I use Netcode. Here are my code samples. So my problem is, when I use NetworkVariable with abstract class, it’s throwing
Null Reference Exception
. I gave my 2 - 3 days for this little problem. And there is no exception catch info or something like that. So, I think this is a serious bug with NetworkVariable between inhereted classes. Please if I’m wrong let me know, or just write your opinion. Have a nice coding everyone !


First, code is text so please post it as text, and put it in code tags.
Secondly, there’s not nearly enough code to diagnose your issue. None of the classes you screenshotted is abstract. And the error message should have more details than just the first line, it points you directly to the line in question. Also, no mention of when or under which circumstances the exception occurs.
Thirdly, don’t just assume it’s a “serious bug”. It’s more likely going to vanish after a serious facepalm. 
I’m sorry, it wasn’t about Abstract classes. It’s about Inhereted classes. When I create Inhereted class and write a NetworkVariable in it, when game start, it’s giving NullReferenceException .
Again, do not screenshot code but copy the code as text!
Post all the relevant code, including PlayerData and the full error message (Console has a details pane and ctrl+c works in there too).
Note that if you intend to add all possible player state into PlayerData, then every time any of these values changes a full transfer of the entire state is performed which is increasingly inefficient the more fields you have in that PlayerData. Primarily networking is about reducing how much state is synchronized as much as possible.