Add per-pose fall animation state and clip
Play a dedicated falling animation when the player is airborne and descending past a scale-aware velocity threshold. - PlayerCharacterController: new IsFalling state + Fall Animation Speed threshold (true only when !grounded && !wallClimbing && descending, scaled via CapsuleScale); explicitly false during wall/ceiling climb. - PlayerPose: per-pose Fall Clip + Fall Clip Speed (mirrors walk/run). - PlayerPoseController: select the fall clip while falling, fall back to the idle clip when a pose has none (no regression). - Author content: Paintman-Fall.anim assigned to Pose_Idle; UMotion project, Player prefab and scene authoring. - Docs: check off the fall animation in GAME_DESIGN.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
fc73e26da1
commit
3b26f2e622
10 files changed
+11515
-101
No files matched your search
@@ -38,6 +38,14 @@ public class PlayerPose : ScriptableObject
|
||||
[Range(0.1f, 3f)]
|
||||
[SerializeField] private float runClipSpeed = 1f;
|
||||
|
||||
[Tooltip("Optional. Played instead of the idle clip while falling (airborne and descending past the " +
|
||||
"controller's fall threshold). Leave empty to keep holding the idle pose while falling. Should loop.")]
|
||||
[SerializeField] private AnimationClip fallClip;
|
||||
|
||||
[Tooltip("Playback speed multiplier for the fall clip. 1 = authored speed.")]
|
||||
[Range(0.1f, 3f)]
|
||||
[SerializeField] private float fallClipSpeed = 1f;
|
||||
|
||||
[Header("Collision")]
|
||||
[Tooltip("CharacterController capsule center Y while this pose is active (meters, local space). Lower " +
|
||||
"this together with Height so a short pose still rests its feet on the floor.")]
|
||||
@@ -82,6 +90,12 @@ public class PlayerPose : ScriptableObject
|
||||
/// <summary>Playback speed multiplier for the run clip (1 = authored speed).</summary>
|
||||
public float RunClipSpeed => runClipSpeed;
|
||||
|
||||
/// <summary>Optional clip played while falling; null = hold the idle pose.</summary>
|
||||
public AnimationClip FallClip => fallClip;
|
||||
|
||||
/// <summary>Playback speed multiplier for the fall clip (1 = authored speed).</summary>
|
||||
public float FallClipSpeed => fallClipSpeed;
|
||||
|
||||
/// <summary>CharacterController capsule center Y applied while this pose is active.</summary>
|
||||
public float ControllerCenterY => controllerCenterY;
|
||||
|
||||
|
||||
Reference in new issue
Block a user