FirstGearGames / FishNet

FishNet: Unity Networking Evolved.
Other
1.39k stars 149 forks source link

SyncVar value getting reset on scene load for host #720

Closed maxkratt closed 4 months ago

maxkratt commented 4 months ago

General Unity version: 6000.0.5f1 Fish-Networking version: 4.3.7 Pro Discord link: https://discord.com/channels/424284635074134018/1262225558964797462/1262225558964797462

Description When the host loads a new global scene and moves player objects into it, on the host side, the remote player object's SyncVar values get reset. This does not trigger an OnChange, it's just happening on the host for some reason.

Replication Steps to reproduce the behavior:

  1. Import example
  2. Add both scenes to build settings
  3. Open StartScene
  4. Start a host client and a solo client
  5. In the host client observe that the SyncVars on the Player objects are filled in
  6. Press the "L" key to load a new scene globally and move the players into it
  7. In the host client observe that the SyncVar on the remote Player object has been reset to blank, but it is fine for the host player object.

Expected behavior It's expected that this doesn't happen.

Video https://github.com/user-attachments/assets/eda70dd0-5e2a-4e27-a9bf-1cdb36a1b472

Example File SyncVarResetBug.zip

FirstGearGames commented 4 months ago

Confirmed. Can also be reproduced as clientHost only by taking clientHost player and moving a scene object out of observation range, then back in again.

FirstGearGames commented 4 months ago

resolved in 4.3.8

AustinEast commented 4 months ago

Thanks for the quick turn-around ❤️