Skip to content

Claude/fix unit animations f9 vu p#1156

Merged
braedonsaunders merged 2 commits into
mainfrom
claude/fix-unit-animations-f9VuP
Jan 30, 2026
Merged

Claude/fix unit animations f9 vu p#1156
braedonsaunders merged 2 commits into
mainfrom
claude/fix-unit-animations-f9VuP

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

No description provided.

The UnitRenderer uses Velocity component data to determine if a unit is
moving (for walk/idle animation transitions). In worker mode, entities
come from RenderStateWorldAdapter which was missing a VelocityAdapter,
causing entity.get('Velocity') to always return undefined.

This resulted in isMoving always being false, so units would only play
idle animations even while moving.

The fix adds a VelocityAdapter that derives velocity from position delta
(current - previous) using the prevX/prevY data already in UnitRenderState.

https://claude.ai/code/session_01NUQdm7SkEPq2rQZcSFmRQf
The RenderStateWorldAdapter was missing several properties that renderers
need for proper functionality in worker mode:

Units:
- targetX, targetY: needed for CommandQueueRenderer waypoint visualization
- commandQueue: needed for shift-click command queue visualization
- attackRange, sightRange: needed for GameOverlay range ring rendering
- speed: needed for VehicleEffectsSystem speed-based effects

Buildings:
- attackRange, sightRange: needed for GameOverlay range ring rendering

Changes:
1. types.ts: Added new properties to UnitRenderState and BuildingRenderState
   interfaces, plus SerializedQueuedCommand type
2. GameWorker.ts: Updated collectUnitRenderState() and
   collectBuildingRenderState() to populate the new fields
3. RenderStateAdapter.ts: Updated UnitAdapter and BuildingComponentAdapter
   to expose the new properties

https://claude.ai/code/session_01NUQdm7SkEPq2rQZcSFmRQf
@braedonsaunders braedonsaunders merged commit d04460c into main Jan 30, 2026
4 checks passed
@braedonsaunders braedonsaunders deleted the claude/fix-unit-animations-f9VuP branch January 31, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants