From 5be0e07115d162d0e2429ca9067d3f712d45147a Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 11 Apr 2026 20:30:39 +0200 Subject: [PATCH] Add maxSpeed and bunny hop properties to player movement --- src/runtime-three/first-person-navigation-controller.ts | 5 ++++- src/runtime-three/runtime-scene-build.ts | 7 ++++++- src/runtime-three/third-person-navigation-controller.ts | 5 ++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/runtime-three/first-person-navigation-controller.ts b/src/runtime-three/first-person-navigation-controller.ts index d9cf2e04..f9d40c32 100644 --- a/src/runtime-three/first-person-navigation-controller.ts +++ b/src/runtime-three/first-person-navigation-controller.ts @@ -50,6 +50,7 @@ function cloneRuntimePlayerMovement( return { templateKind: movement.templateKind, moveSpeed: movement.moveSpeed, + maxSpeed: movement.maxSpeed, capabilities: { jump: movement.capabilities.jump, sprint: movement.capabilities.sprint, @@ -60,7 +61,9 @@ function cloneRuntimePlayerMovement( bufferMs: movement.jump.bufferMs, coyoteTimeMs: movement.jump.coyoteTimeMs, variableHeight: movement.jump.variableHeight, - maxHoldMs: movement.jump.maxHoldMs + maxHoldMs: movement.jump.maxHoldMs, + bunnyHop: movement.jump.bunnyHop, + bunnyHopBoost: movement.jump.bunnyHopBoost }, sprint: { speedMultiplier: movement.sprint.speedMultiplier diff --git a/src/runtime-three/runtime-scene-build.ts b/src/runtime-three/runtime-scene-build.ts index 7877779d..bcba0da1 100644 --- a/src/runtime-three/runtime-scene-build.ts +++ b/src/runtime-three/runtime-scene-build.ts @@ -115,6 +115,7 @@ export interface RuntimePlayerStart { export interface RuntimePlayerMovement { templateKind: PlayerStartMovementTemplate["kind"]; moveSpeed: number; + maxSpeed: number; capabilities: PlayerStartMovementCapabilities; jump: PlayerStartJumpSettings; sprint: PlayerStartSprintSettings; @@ -282,7 +283,9 @@ function clonePlayerStartJumpSettings( bufferMs: jump.bufferMs, coyoteTimeMs: jump.coyoteTimeMs, variableHeight: jump.variableHeight, - maxHoldMs: jump.maxHoldMs + maxHoldMs: jump.maxHoldMs, + bunnyHop: jump.bunnyHop, + bunnyHopBoost: jump.bunnyHopBoost }; } @@ -308,6 +311,7 @@ function cloneRuntimePlayerMovement( return { templateKind: movement.templateKind, moveSpeed: movement.moveSpeed, + maxSpeed: movement.maxSpeed, capabilities: clonePlayerStartMovementCapabilities(movement.capabilities), jump: clonePlayerStartJumpSettings(movement.jump), sprint: clonePlayerStartSprintSettings(movement.sprint), @@ -323,6 +327,7 @@ function buildRuntimePlayerMovement( return { templateKind: resolvedTemplate.kind, moveSpeed: resolvedTemplate.moveSpeed, + maxSpeed: resolvedTemplate.maxSpeed, capabilities: clonePlayerStartMovementCapabilities( resolvedTemplate.capabilities ), diff --git a/src/runtime-three/third-person-navigation-controller.ts b/src/runtime-three/third-person-navigation-controller.ts index e8b166b8..44c9cd2d 100644 --- a/src/runtime-three/third-person-navigation-controller.ts +++ b/src/runtime-three/third-person-navigation-controller.ts @@ -64,6 +64,7 @@ function cloneRuntimePlayerMovement( return { templateKind: movement.templateKind, moveSpeed: movement.moveSpeed, + maxSpeed: movement.maxSpeed, capabilities: { jump: movement.capabilities.jump, sprint: movement.capabilities.sprint, @@ -74,7 +75,9 @@ function cloneRuntimePlayerMovement( bufferMs: movement.jump.bufferMs, coyoteTimeMs: movement.jump.coyoteTimeMs, variableHeight: movement.jump.variableHeight, - maxHoldMs: movement.jump.maxHoldMs + maxHoldMs: movement.jump.maxHoldMs, + bunnyHop: movement.jump.bunnyHop, + bunnyHopBoost: movement.jump.bunnyHopBoost }, sprint: { speedMultiplier: movement.sprint.speedMultiplier