enemies spawn with offsets in positions and animations
This commit is contained in:
parent
d1930a6b00
commit
53e7fc78a7
4 changed files with 35 additions and 12 deletions
|
|
@ -120,6 +120,13 @@ namespace TD.Gameplay
|
|||
{
|
||||
status = GetComponent<EnemyStatus>();
|
||||
|
||||
// Randomize the walk-cycle phase on every peer independently. Animations
|
||||
// are purely visual and not replicated, so each client picks its own offset —
|
||||
// the result looks correct everywhere without any network traffic.
|
||||
var animator = GetComponentInChildren<Animator>();
|
||||
if (animator != null)
|
||||
animator.Update(Random.Range(0f, 2f));
|
||||
|
||||
if (!IsServer) return;
|
||||
|
||||
if (!hasPendingInit)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue