Skip to content

Commit 99dc876

Browse files
fix: networkanimator auto owner authoritative mode when in distributed authority (#3021)
* fix When in distributed authority, always use the owner authoritative mode as default. * update adding change log entry * update adding the PR number to the change log entry
1 parent 977746d commit 99dc876

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
2525

2626
### Changed
2727

28+
- Changed `NetworkAnimator` to automatically switch to owner authoritative mode when using a distributed authority network topology. (#3021)
2829
- Changed permissions exception thrown in `NetworkList` to exiting early with a logged error that is now a unified permissions message within `NetworkVariableBase`. (#3004)
2930
- Changed permissions exception thrown in `NetworkVariable.Value` to exiting early with a logged error that is now a unified permissions message within `NetworkVariableBase`. (#3004)
3031

com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,13 @@ internal bool IsServerAuthoritative()
498498
/// <summary>
499499
/// Override this method and return false to switch to owner authoritative mode
500500
/// </summary>
501+
/// <remarks>
502+
/// When using a distributed authority network topology, this will default to
503+
/// owner authoritative.
504+
/// </remarks>
501505
protected virtual bool OnIsServerAuthoritative()
502506
{
503-
return true;
507+
return NetworkManager ? !NetworkManager.DistributedAuthorityMode : true;
504508
}
505509

506510
// Animators only support up to 32 parameters

0 commit comments

Comments
 (0)