Scene-driven movement animations#3
Merged
Merged
Conversation
Replace the engine's built-in walk/run/jump/idle selection with a scene-driven equivalent written via MovementAnimation. selectAnimation reads the scene's own jump/ground state directly (jumpStartHeight, grounded, currentJumpHeight) rather than recomputing jump physics, and holds the landing clip until the engine reports (loopCount/playbackTime) that it has completed. Adds run.glb + jump.glb and exports currentJumpHeight from vertical.ts so the jump clip's playback speed tracks the ascent time-to-peak. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Referenced by selectAnimation but previously left untracked. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
A release followed by a re-press while still airborne kept jumpStartHeight defined but re-engaged the continuing-jump branch with a decayed jumpSpeedCap, which collapsed to a negative and drove velocity.y deeply negative. Once landed, the scene kept reporting mid-jump and broadcast a large negative y velocity. Track the release so continuing-jump is blocked until a fresh ground press resets it. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Updates @dcl/sdk to the js-sdk-toolchain PR #1377 build that ships MovementAnimation / AvatarAnimationState / AvatarMovement protos. Drops the redundant @dcl/ecs / @dcl/js-runtime / @dcl/sdk-commands direct deps — @dcl/sdk pulls matching versions transitively, so pinning them at the previous PR's tarballs just fought resolution.
Publish avatar-bus audio hashes on walk/run step crossings, jump takeoff, and landing so the scene-driven animation path exercises the sounds field end-to-end. Timings and variant pools mirror the native built-ins; clip- relative crossing detection is forward-only to avoid a burst of triggers when the walk clip's playback speed goes negative during turns. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Port the engine's fallback-path hold into selectAnimation: once the clip passes its midpoint (which our ttp-scaled speed reaches at the physical apex), set speed to 0 so the pose freezes. Without this, falling from a high place loops the takeoff pose repeatedly. We deliberately don't re-seek each frame — the engine preserves playback position while speed is 0, and an explicit seek visibly hiccups the pose. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The previous `landFrame = s.loop` condition was meant to catch the tick we transitioned from looping ascent to non-looping landing, but engine CRDT latency kept reporting the clip as loop=true for several ticks after we switched the request, so the sound retriggered every frame. Replace with a `landSoundFired` latch reset on a new jump, fired once on the first tick of the landing block. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Key the landing sound off the airborne->grounded transition and a >0.5m drop threshold instead of a one-shot latch tied to jumps. This covers walking off platforms while keeping small step-offs silent. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@dcl/sdkat the js-sdk-toolchain PR #1377 artifact that shipsMovementAnimation/AvatarAnimationState/AvatarMovementprotos.Dependencies