FirstGearGames / FishNet

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

Changing SyncVar Value before nob Spawn calling OnChange only with asServer: true on Host #661

Closed SnaiperoG3D closed 5 months ago

SnaiperoG3D commented 7 months ago

General Unity version: 2021.3.30f1 Fish-Networking version: 4.2.2Pro Discord link: https://discord.com/channels/424284635074134018/1034477094731784302/1236053687047163916

Description On v4 fish version, changing SyncVar Value before nob spawn cause onChange call only once with asServer: true on Host.

Replication Define any SyncVar in NB with onChange method realized with simple debug log. Instantiate nob -> change SyncVar -> spawn nob -> onChange will be called only once with asServer: true on Host. Instantiate nob -> spawn nob -> change SyncVar -> onChange will be called twice, with asServer: true and asServer: false on Host as it should.

Expected behavior 2 onChange calls, with asServer: true and asServer: false

Idk if this was done on purpose or not, but there is no such problem on fish v3.

FirstGearGames commented 6 months ago

Posting a discord link with the same report is not considered 'troubleshooting' the issue. This does sound like it could be a bug but without seeing replication steps, such as where you are changing the value, nothing can be done.

SnaiperoG3D commented 6 months ago

i sent scripts to discrod dm to reproduce the problem there are test scripts to reproduce this issue this script need to be placed in the scene go: https://pastebin.com/RJ3myge9 and this script on prefab, which will be spawned by previous one: https://pastebin.com/FGTUWqzt

SnaiperoG3D commented 6 months ago

fish_syncvar_bug.zip

FirstGearGames commented 6 months ago

fish_syncvar_bug.zip

ty! Will check into this asap.

FirstGearGames commented 6 months ago

Resolved in 4.3.4