-
Notifications
You must be signed in to change notification settings - Fork 450
fix: NetworkAnimator not synchronizing changes to layer weights #2399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e37e030
f6046a5
632319b
ff17dcd
93b8d1b
ea750cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,13 +179,27 @@ private void BeginAttack(int weaponType) | |
m_NetworkAnimator.SetTrigger("Attack"); | ||
} | ||
|
||
private void SetLayerWeight(int layer, float weight) | ||
{ | ||
m_Animator.SetLayerWeight(layer, weight); | ||
} | ||
|
||
private float GetLayerWeight(int layer) | ||
{ | ||
return m_Animator.GetLayerWeight(layer); | ||
} | ||
|
||
private void LateUpdate() | ||
{ | ||
|
||
if (!IsSpawned || !IsOwner) | ||
{ | ||
if (!IsOwner && IsSpawned) | ||
{ | ||
if (Input.GetKeyDown(KeyCode.Alpha4)) | ||
{ | ||
Debug.Log($"Layer 1 weight: {GetLayerWeight(1)}"); | ||
} | ||
DisplayTestIntValueIfChanged(); | ||
return; | ||
} | ||
|
@@ -229,6 +243,10 @@ private void LateUpdate() | |
BeginAttack(2); | ||
} | ||
|
||
if (Input.GetKeyDown(KeyCode.Alpha3)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This too There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is part of the manual test that just allows you to verify that when changes are applied to a layer's weight that it was updated on other non-authoritative/owner instances. |
||
{ | ||
SetLayerWeight(1, 0.75f); | ||
} | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like debug code maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is part of the manual test that just allows you to verify that when changes are applied to a layer's weight that it was updated on other non-authoritative/owner instances.