New UNetWeaver error

I have a project using UNET fairly extensively. It works great in both 5.1 and 5.2.

Opening the project in 5.3.0f2 produces the following weaver error:

^^ I inserted spaces after a couple colons to prevent smilies.

I checked the source of NetworkInstanceId at https://bitbucket.org/Unity-Technologies/networking/src/c26a8146968cbd61c2017b3e49327f3d2c3996fa/Runtime/NetworkInstanceId.cs?at=5.2&fileviewer=file-view-default and didn’t see anything suspect, albeit that is the source for 5.2.

Interestingly, I can’t reproduce it by writing scripts in a new project. Did something change? Or should I look at something else?

Look at the editor log file for more details.

Hi folks I’ve got more info on this one.

After trying to port my existing project to the 5.3.0f2 beta I got the same error as posted by brianturner.
Investigations found that if you have >= 16 syncvars (and possibly any networking tag e.g. [SyncVar], [Command], [ClientRpc]) you get this error. The recursion depth error will specify the type of whatever that sixteenth thing was that was trying to be serialized.

I’ve attached a script that is just a NetworkBehaviour with 16 public [SynchVars] in it. Add it to your project and you’ll get the above error. Comment out any SyncVar tag and it’ll compile.

Hope this helps,
Jas

@seanr - please see bug in the Issue Tracker: Case 749253

2403297–164060–SyncVarsScript.cs (3.32 KB)

1 Like

Thanks for the report and repro case.

I removed all SyncVar, Command, and ClientRpc tags from several of my classes and the error disappeared. Removing SyncVars from my classes was not enough.

Although the error is gone, obviously the project’s networking won’t work.

I find the weaver throws a fit whenever there’s something silly i’ve done (ie lack of meaningful error messages)

I’m getting an error like this in a class with no SyncVars. I commented out the 4 rpc’s it complains about, and the error goes away. I then uncommented one of the rpcs and commented out its method body, still get the error. If I comment out the 2 integer parameters, the error goes away.