WriteDelta does not work correctly for NetworkVariable<List<Class>> due to incorrect handling of duplicates in ListSerializer #3087
Labels
Investigating
Issue is currently being investigated
stat:awaiting triage
Status - Awaiting triage from the Netcode team.
type:bug
Bug Report
Title
WriteDelta does not work correctly for
NetworkVariable<List<Class>>
due to incorrect handling of duplicates inListSerializer
Description
The
Duplicate
method in theListSerializer
does not make copies of the instances within the list. As a result, when the number of elements in the list changes, it marks the list as Dirty correctly, but changes to the contents of the class instances within the list do not trigger the Dirty state.The
Class
in question implementsINetworkSerializable
andIEquatable
as expected, so this behavior is unexpected. Since a simple solution isn’t apparent, I recommend adding a managed version ofNetworkList
. Additionally, implementing an ILPP error for cases like this would be beneficial.Reproduce Steps
NetworkVariable<List<Class>>
.Actual Outcome
Modifying the properties of instances within the list does not trigger
WriteDelta
, and the list does not enter the Dirty state.Expected Outcome
Modifying the properties of instances within the list should trigger the Dirty state for the list as a whole.
Screenshots
(If applicable, add screenshots to help explain your problem)
Environment
Additional Context
Additional context related to the problem is provided below.
Please include logs or code snippets, and if possible, attach a minimal Unity project that reproduces the issue.
The text was updated successfully, but these errors were encountered: