diff --git a/server/src/worlds/entities/controllers/DefaultPlayerEntityController.ts b/server/src/worlds/entities/controllers/DefaultPlayerEntityController.ts index a957eb0c..4714e589 100644 --- a/server/src/worlds/entities/controllers/DefaultPlayerEntityController.ts +++ b/server/src/worlds/entities/controllers/DefaultPlayerEntityController.ts @@ -594,6 +594,7 @@ export default class DefaultPlayerEntityController extends BaseEntityController } // Handle movement animations and audio + const scaleMultiplier = entity.height / DefaultPlayerEntityController.BASE_ENTITY_HEIGHT; if (this.isGrounded && !this.isSwimming && this._isActivelyMoving && !hasConflictingInputs && canMove) { // Ground movement animations const animations = isFastMovement ? this.runLoopedAnimations : this.walkLoopedAnimations; @@ -601,16 +602,18 @@ export default class DefaultPlayerEntityController extends BaseEntityController for (const animation of animations) { entity.getModelAnimation(animation)?.setLoopMode(EntityModelAnimationLoopMode.LOOP); entity.getModelAnimation(animation)?.play(); + entity.getModelAnimation(animation)?.setPlaybackRate(scaleMultiplier); } - this._stepAudio?.setPlaybackRate(isFastMovement ? 0.75 : 0.51); + this._stepAudio?.setPlaybackRate((isFastMovement ? 0.75 : 0.51) * scaleMultiplier); this._stepAudio?.play(entity.world, !this._stepAudio?.isPlaying); } else if (this._isFullySubmerged && this.canSwim(this)) { this._stepAudio?.pause(); if (this._isActivelyMoving) { entity.stopAllModelAnimations(animation => this.swimLoopedAnimations.includes(animation.name) || animation.loopMode === EntityModelAnimationLoopMode.ONCE); - for (const animation of this.swimLoopedAnimations) { + for (const animation of this.swimLoopedAnimations) { entity.getModelAnimation(animation)?.setLoopMode(EntityModelAnimationLoopMode.LOOP); entity.getModelAnimation(animation)?.play(); + entity.getModelAnimation(animation)?.setPlaybackRate(scaleMultiplier); } } else { entity.stopAllModelAnimations(animation => this.swimIdleLoopedAnimations.includes(animation.name) || animation.loopMode === EntityModelAnimationLoopMode.ONCE);