Rework wall-climb controls: constant W/S climb, mouse-drag wall pose

- W/S climb straight up/down at a constant speed (camera pitch no longer
  tilts or slows them); the camera only drives A/D strafe along the wall.
- The body now always faces the wall. Holding LMB and dragging sets the
  wall pose: vertical drag leans out from / back to the wall (offset eases
  back to zero while moving, never detaches), horizontal drag turns the
  body (yaw held until leaving the wall, eased back by ground rotation).
- Pause the camera orbit while dragging the wall pose (LookSuppressed).
- Drop the camera-to-wall angle logic and the old approach/detach-distance
  model; add wallMaxOffset, wallOffsetSensitivity, wallOffsetReturnSpeed
  and wallRotateSensitivity.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-06-22 18:36:58 +02:00
1 parent f758c96dc5
commit 4c9eef18f4
2 files changed
+150 -52

No files matched your search

+10 -3
View File
@@ -64,6 +64,13 @@ public class ThirdPersonOrbitInput : MonoBehaviour
set { lookMode = value; ApplyCursorState(); }
}
/// <summary>
/// While true, mouse-look is paused (orbit frozen) without changing the cursor
/// state. The player controller sets this while dragging the wall-climb offset so
/// the same mouse motion is not also spent orbiting the camera.
/// </summary>
public bool LookSuppressed { get; set; }
void Awake()
{
_orbit = GetComponent<CinemachineOrbitalFollow>();
@@ -80,12 +87,12 @@ public class ThirdPersonOrbitInput : MonoBehaviour
if (!_orbit)
return;
bool rotating = ShouldRotate();
bool modeWantsLook = ShouldRotate();
if (manageCursor)
SetCursorLocked(rotating);
SetCursorLocked(modeWantsLook);
if (rotating)
if (modeWantsLook && !LookSuppressed)
{
Vector2 delta = ReadMouseDelta();
if (delta.sqrMagnitude > 0f)