Add first-person camera mode with pose-aware eye offset and yaw facing

Introduce a FirstPersonController / FirstPersonMode pair (mirroring the
free-cam mode) wired into the GameModeManager Tab cycle. In first person the
mesh is hidden, the eye sits on CameraTarget plus a per-pose
firstPersonCameraTargetYOffset, and the character body yaw is driven to match
the camera via a new single-writer FaceYaw hook on PlayerCharacterController.

Also includes user content edits (poses, prefabs, scene) carried along.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-06-27 13:03:52 +02:00
1 parent 381b21cd02
commit cfb767f6cb
17 files changed
+681 -91

No files matched your search

+14 -2
View File
@@ -147,6 +147,13 @@ public partial class PlayerCharacterController : MonoBehaviour
/// </summary>
public bool ControlEnabled { get; set; } = true;
/// <summary>
/// When set, the body faces this world-space yaw (degrees) every frame instead of turning toward its
/// movement direction. First-person sets it so the character always faces where the camera looks;
/// null restores movement-facing. Only affects ground/air locomotion — wall-climb owns its own facing.
/// </summary>
public float? FaceYaw { get; set; }
/// <summary>True while in wall-climb mode.</summary>
public bool IsWallClimbing => _isWallClimbing;
@@ -425,8 +432,13 @@ public partial class PlayerCharacterController : MonoBehaviour
if (!_groundNormalUpdated)
_groundNormal = Vector3.up;
// Face the movement direction, unless the right-button turn is actively steering the body.
if (rotateTowardMovement && !groundYawDrag && moveDir.sqrMagnitude > 0.0001f)
// Facing: first-person pins the body to the camera yaw (even while idle); otherwise turn toward
// the movement direction, unless the right-button turn is actively steering the body.
if (FaceYaw.HasValue)
{
transform.rotation = Quaternion.Euler(0f, FaceYaw.Value, 0f);
}
else if (rotateTowardMovement && !groundYawDrag && moveDir.sqrMagnitude > 0.0001f)
{
Quaternion target = Quaternion.LookRotation(moveDir, Vector3.up);
transform.rotation = Quaternion.RotateTowards(