working move kikle

This commit is contained in:
math-pixel
2026-05-19 16:34:48 +02:00
parent 1ead7ab3a7
commit 5893afe42a
2 changed files with 29 additions and 14 deletions
+10 -3
View File
@@ -120,15 +120,22 @@ export function PlayerController({
useEffect(() => {
if (movementMode === "ebike") {
// Teleport player capsule to the bike's current parked position
const targetPos: Vector3Tuple = (window as any).ebikeParkedPosition || [0, 10, 0];
const targetPos: Vector3Tuple = (window as any).ebikeParkedPosition || [0, 8.2, 0];
const targetRot: number = (window as any).ebikeParkedRotation || 0;
const headY = targetPos[1] + PLAYER_EYE_HEIGHT;
const bottomY = targetPos[1] + PLAYER_CAPSULE_RADIUS;
capsule.current.start.set(
targetPos[0],
targetPos[1] - PLAYER_EYE_HEIGHT + PLAYER_CAPSULE_RADIUS,
bottomY,
targetPos[2],
);
capsule.current.end.set(
targetPos[0],
headY,
targetPos[2],
);
capsule.current.end.set(...targetPos);
velocity.current.set(0, 0, 0);
onFloor.current = false;
wantsJump.current = false;