Closed GuilhermeGSousa closed 3 years ago
Do you mind trying to reproduce this on latest develop
branch instead of master
0.1.0?
Hi @MFatihMAR, I just switched to develop (c1ee3b62), and I get the same behaviour (no server rpc is called), but no exception is raised this time.
hmm, interesting. can you attach some code snippets from your scripts so that we could reproduce this issue locally on our side too?
I'll try to setup a minimalistic project that reproduces the error today
I couldn't reproduce the bug on a new project, and after some refactoring/code cleanup on my own project the exception disapeared. In hindsight it was probably related to the fact that I was starting up the client (NetworkManager.Singleton.StartClient()
) on a scene that had other NetworkObjects.
As I am unable to reproduce this in a controlled environment I'll leave to your discretion weather to close this issue.
ugh, it's sad to hear that we reached to a dead end. one more question though, did you upgrade from 0.1.0 (master branch) to latest develop and got these issues in the project? or was it a fresh package install either 0.1.0 master or latest develop? that might give us a clue about what is not cleaning up after itself.
No I was already on the 0.1.0 release when I had the exception raised, I then upgraded to the latest develop and had the same issue, without the exception. If you wish to invesigate further I can give the exact version of my personal project that had these issues, it is honestly the only way I can think of to reproduce this.
I see. I think 0.1.0 to develop transition wouldn't be super smooth with ILPP and cached assemblies. deleting Library and Temp folder would force Unity to recompile/reimport and I believe that'd fix issues you were having. obviously, not the best solution but hopefully we won't have these weird issues again in the future :)
thank you very much for following up on this and letting us be aware of it.
Describe the bug A
InvalidCastException: Specified cast is not valid.
exception is raised when a ServerRpc is called by a connected client.To Reproduce With a host on the Unity Editor and a build running a client, call a serverRpc like this one:
Note that this error does not happen if both the host and client run on builds, nor if the client runs on the editor and host on build.
Actual outcome
NetworkManager.cs:1145 raises an InvalidCastException, on the following line of code:
Error log:
Expected outcome The ServerRpc should be called without raising an exception.
Screenshots N/A
Environment (please complete the following information):
Additional context I recently changed to the new Unity Hub beta, I had this error for the first time when running this code after that change. The same code would work fine before that. I may update this issue with a minimal project to reproduce the error if I have some time available.