MirrorNetworking / MirrorNetworking/Mirror
Scene objects are not reset after disconnecting
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 870
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When disconnecting & reconnecting to a server as a client without reloading the scene, the state of scene network objects is not reset.
This might lead to syncvar hooks not firing since the syncvar is still the same.
I'm not sure if this qualifies as a bug or is worth fixing, just something I stumbled upon
How to reproduce the issue, step by step
Add SyncVar to networked scene object
[SyncVar(hook = nameof(BlaChanged))]
public string bla = 0;
void BlaChanged(string old, string bla)
{
Debug.LogError($"{gameObject.name} - Changed from {old} to {bla}");
}
- Leave at default value, connect client, no SyncVar hook fires ✅
- Disconnect client, change to something different, reconnect client without restarting, SyncVar hook fires ✅
- Disconnect client, change back to default value, reconnect client without restarting, SyncVar hook fires with "default" value ❓
Expected behavior
It might be more intuitive to reset scene objects to their default state when disconnecting
Screenshots
left side: host, inspector: networked scene object, right side: client
https://share.dl.je/2021/03/2021-03-24_00-45-33_qXvCbPvObp.mp4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with a networked scene object containing a SyncVar, following the disconnect/reconnect sequence described in the report. Trace the scene-object lifecycle during client disconnect and reconnect, and verify that objects return to their default state and SyncVar hooks behave consistently on subsequent connections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- game-dev, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100