enemies spawn with offsets in positions and animations

This commit is contained in:
Ian Woods 2026-06-23 21:16:12 -07:00
parent d1930a6b00
commit 53e7fc78a7
4 changed files with 35 additions and 12 deletions

View file

@ -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)