-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rpc and NetworkVariable won't work after PlayerPrefab respawned #3059
Comments
I'm not seeing the issue on either 2.0.0-pre.4 or latest NGO. When running the sample (I retrieved it from, the discussions thread) I see the client continually destroy and recreate itself and I see the RPC being sent for both clients. Given your description of your issue I was expecting after the respawn the client would no longer receive its RPCs. I've closed out the issue but if you can still reproduce it please re-open it with any more reproduction steps you have and I will take another look. |
Hi @samlucas-unity, it was me who replied to that thread (cerestorm) and I guess I wasn't clear enough to the OP. The issue is if the client Player object is Destroyed by the host (as opposed to being Despawned) the client is removed as an observer from any other network objects. NGO 1.11 copes with this with the client still observing but the references to the client under Observers goes blank in the Unity editor, which makes sense as they're a reference to the client's Player object. I've attached the code I used to test this if it helps. |
Thanks for the reply, that really helped me get a solid repro of this issue. It is a regression from 1.11 and we have identified the code and I have a fix ready I'm just getting some tests around this to catch it in the future. For now you can remove this code:
In NetworkSpawnManager.cs. I've reopened this issue and will close it again once I land the PR. Thanks, Sam |
Description
When the client’s Player is destroyed it’s also removing the client as an observer on other network objects.
Here is a simple test scene
Environment
Additional Context
This happens in version 2.0.0-pre.4, 1.11 has no such issue.
Cerestorm and I found this bug.
The text was updated successfully, but these errors were encountered: