FishNet icon indicating copy to clipboard operation
FishNet copied to clipboard

Setting a SyncVar's field and using Dirty doesn't correctly update the SyncVar

Open maxkratt opened this issue 1 year ago • 0 comments

General Unity version: 2022.3.16f1 Fish-Networking version: 4.1.4R Pro Discord link: https://discord.com/channels/424284635074134018/966848379298652200/1221825451786375172

Description Setting a field on a class that is a SyncVar and then calling Dirty on the SyncVar does not invoke the OnChange method for the server, and it does not set that value for new observers.

Replication Steps to reproduce the behavior:

  1. Import the sample and open the scene
  2. Press play and see how the OnChange method isn't invoked
  3. Launch another client and see how the SyncVar isn't updated for the new observing client

Expected behavior I would expect it to be synced properly when using Dirty

Example SyncVarBug.zip

maxkratt avatar Mar 26 '24 12:03 maxkratt