You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: NetworkAnimator parameters writebuffer is limited [backport] (#3124)
* fix
Pre-calculate the required parameter write size needed as opposed to using the legacy constant value.
* update
adding changelog entry
* update
Adding PR number to changelog entry
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
17
17
18
18
### Fixed
19
19
20
+
- Fixed issue where `NetworkAnimator` would statically allocate write buffer space for `Animator` parameters that could cause a write error if the number of parameters exceeded the space allocated. (#3124)
20
21
- Fixed issue with the in-scene network prefab instance update menu tool where it was not properly updating scenes when invoked on the root prefab instance. (#3084)
21
22
- Fixed issue where `NetworkAnimator` would send updates to non-observer clients. (#3058)
22
23
- Fixed issue where an exception could occur when receiving a universal RPC for a `NetworkObject` that has been despawned. (#3055)
@@ -560,6 +556,14 @@ public override void OnDestroy()
560
556
561
557
privatevoidAwake()
562
558
{
559
+
if(!m_Animator)
560
+
{
561
+
#if !UNITY_EDITOR
562
+
Debug.LogError($"{nameof(NetworkAnimator)}{name} does not have an {nameof(UnityEngine.Animator)} assigned to it. The {nameof(NetworkAnimator)} will not initialize properly.");
563
+
#endif
564
+
return;
565
+
}
566
+
563
567
intlayers=m_Animator.layerCount;
564
568
// Initializing the below arrays for everyone handles an issue
565
569
// when running in owner authoritative mode and the owner changes.
@@ -589,6 +593,9 @@ private void Awake()
589
593
}
590
594
}
591
595
596
+
// The total initialization size calculated for the m_ParameterWriter write buffer.
597
+
vartotalParameterSize=sizeof(uint);
598
+
592
599
// Build our reference parameter values to detect when they change
0 commit comments