Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

arena: prevent player rotation during right-click orbit

Lock cam.rotY to baseRotY when orbiting so camdoll's look-around input
doesn't affect player rotation. The orbit only affects camera position
(cam.x/z), not the player's facing direction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+9 -1
+9 -1
system/public/aesthetic.computer/disks/arena.mjs
··· 79 79 let orbitAngle = 0; // extra Y rotation for camera only (degrees) 80 80 let orbiting = false; // currently dragging with right button 81 81 let appliedOrbitOffset = [0, 0]; // track X,Z offset we applied so we can undo it 82 + let baseRotY = 0; // cam.rotY when orbit started, to prevent player spinning 82 83 83 84 function applyZoom(doll) { 84 85 if (!doll) return; ··· 482 483 const doll = system?.fps?.doll; 483 484 const cam = doll?.cam; 484 485 if (!cam) return; 486 + 487 + // If orbiting, undo camdoll's rotY change to keep player facing fixed direction 488 + if (orbiting) { 489 + cam.rotY = baseRotY; 490 + } 485 491 486 492 // Undo any orbit offset we applied last frame so it doesn't affect physics 487 493 cam.x -= appliedOrbitOffset[0]; ··· 956 962 } 957 963 958 964 // 🎥 Right-click drag to orbit camera around player (3P mode only). 959 - if (e.is("touch") && e.button === 2) { 965 + const cam = system?.fps?.doll?.cam; 966 + if (e.is("touch") && e.button === 2 && cam) { 960 967 orbiting = true; 968 + baseRotY = cam.rotY; // lock player rotation to current heading 961 969 } else if (e.is("lift") && e.button === 2) { 962 970 orbiting = false; 963 971 } else if (e.is("draw") && e.button === 2) {