Camera-relative wall climb up/down keys to fix grab/release twitch

When running backwards toward the camera into a wall, the grab decided on
the camera-relative world direction (S pushes into the wall -> grab) while
the base release decided on the raw S axis (v < 0 -> immediately let go),
causing a per-frame grab/release flicker.

Mirror the existing _wallStrafeSign A/D latch with a new _wallClimbSign:
the camera picks, per climb-key press, which of W/S climbs up (the one
pushing into the wall) via Dot(camForward, wallNormal) and latches it.
All up/down tests now run through the effective climb axis vEff -
wall->ceiling handoff, top-out detach/hop, the alongSurface mapping and
the base release - so grab and release can no longer contradict each
other. Reset on grab and in ExitWallClimb. Facing the wall and grabbing
with W is unchanged (vEff == v).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-06-27 13:20:15 +02:00
1 parent cfb767f6cb
commit 0a1859cab1
2 files changed
+65 -10

No files matched your search

+32
View File
@@ -1,5 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3409234855347943236
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3881790915792787113}
m_Layer: 0
m_Name: FirstPersonTarget
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3881790915792787113
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3409234855347943236}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.2, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6997860362608943113}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5384024074013944205
GameObject:
m_ObjectHideFlags: 0
@@ -36,6 +67,7 @@ Transform:
m_Children:
- {fileID: 4756699837331941863}
- {fileID: 4348940595172967010}
- {fileID: 3881790915792787113}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!143 &1765171223029840803