Integrate humanoid walk/run animations and per-clip pose speed sliders
- Import Mixamo humanoid Walking + Running FBX, switch rig type to Humanoid - Wire walkClip/runClip with per-clip speeds on Pose_Idle (walk 1.4, run 1.5) - Add per-animation speed sliders (Range 0.1-3, default 1) to PlayerPose SO, applied per frame in PlayerPoseController for live tuning - Reorganize pose assets: replace Pose_TPose with Pose_Hold, prune legacy Paintman-Run/-TPose .anim and paintman_UV.FBX - Ignore UMotion plugin data/editor folders Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
dcfd668422
commit
5dd35dd0f9
24 files changed
+40464
-2273
No files matched your search
@@ -49,8 +49,6 @@ public partial class PlayerCharacterController : MonoBehaviour
|
||||
[Tooltip("Camera used for camera-relative movement. Empty = Camera.main.")]
|
||||
public Transform cameraTransform;
|
||||
|
||||
public Animator animator;
|
||||
|
||||
[Tooltip("Animator bool parameter driven true while running on the ground (false in air and while wall/ceiling-climbing).")]
|
||||
public string runningParameter = "Running";
|
||||
|
||||
@@ -160,6 +158,13 @@ public partial class PlayerCharacterController : MonoBehaviour
|
||||
/// <summary>True while stuck to a ceiling (wall-climb mode with a downward-facing surface normal).</summary>
|
||||
public bool IsOnCeiling => _isWallClimbing && _wallNormal.y < CeilingNormalThreshold;
|
||||
|
||||
/// <summary>
|
||||
/// True while grounded and actually moving above the run threshold (the ground-locomotion state).
|
||||
/// Airborne, wall/ceiling, and standing still all read false. This is the same signal that drives
|
||||
/// the run bool, exposed so the pose system can pick its walk/run locomotion clips.
|
||||
/// </summary>
|
||||
public bool IsMovingOnGround => _movingOnGround;
|
||||
|
||||
/// <summary>
|
||||
/// Set by <see cref="PlayerPoseController"/> while a pose Playable graph owns the Animator output.
|
||||
/// While set, the run-bool is not poked: it would be moot (the graph overrides it) and Unity would
|
||||
@@ -176,6 +181,7 @@ public partial class PlayerCharacterController : MonoBehaviour
|
||||
private Vector3 _horizontalVelocity; // smoothed horizontal move velocity (accel/decel ramp)
|
||||
private bool _sprinting; // sprint key state this frame (exposed via IsSprinting)
|
||||
private bool _isIdle; // snapshot: player essentially still this frame (exposed via IsIdle)
|
||||
private bool _movingOnGround; // snapshot: grounded & moving above the run threshold (exposed via IsMovingOnGround)
|
||||
private float _poseYOffset; // local-up model offset from the active pose (ceiling only); folded into SetMeshLean
|
||||
|
||||
// Ground contact normal from the latest Move (for slope sliding).
|
||||
@@ -308,7 +314,7 @@ public partial class PlayerCharacterController : MonoBehaviour
|
||||
cameraOrbit.LookSuppressed = _offsetDragging;
|
||||
_horizontalVelocity = Vector3.zero; // drop ground momentum so resuming starts from rest
|
||||
_isIdle = ControlEnabled && (h * h + v * v) <= 1e-4f; // attached & no climb input = holding a pose
|
||||
SetAnimatorRunning(false); // climbing is its own pose, not the ground run
|
||||
_movingOnGround = false; // on a wall/ceiling, never ground locomotion
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -377,7 +383,7 @@ public partial class PlayerCharacterController : MonoBehaviour
|
||||
Vector3 horizontalVel = _controller.velocity;
|
||||
horizontalVel.y = 0f;
|
||||
bool movingOnGround = _controller.isGrounded && horizontalVel.sqrMagnitude > RunningSpeedThresholdSqr;
|
||||
SetAnimatorRunning(movingOnGround);
|
||||
_movingOnGround = movingOnGround;
|
||||
_isIdle = ControlEnabled && _controller.isGrounded && !movingOnGround; // standing still on the floor
|
||||
}
|
||||
|
||||
@@ -945,13 +951,6 @@ public partial class PlayerCharacterController : MonoBehaviour
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>Drives the animator's ground-run bool (null-safe; skipped while a pose graph overrides the Animator).</summary>
|
||||
private void SetAnimatorRunning(bool running)
|
||||
{
|
||||
if (animator && !AnimatorOverridden)
|
||||
animator.SetBool(_runningHash, running);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collects contact normals during Move: wall/ceiling contacts feed the
|
||||
/// wall-climb detector, the flattest upward contact becomes the ground normal.
|
||||
|
||||
Reference in new issue
Block a user