From 69b961265625046d960cae94da3be3194ad65814 Mon Sep 17 00:00:00 2001 From: BoroBongo Date: Sun, 22 Nov 2026 19:07:03 +0000 Subject: [PATCH 1/4] fix: crouching while standing still takes the camera down to 0.7 m (kneeling at a chest), moving takes it back to the sneak pose - the body shrinks so its feet stay on the floor The crouch button took the camera to the eyes of the sneak pose (S_SNEAK, 1.41 m at scale 1): only the first crouch of a body reached the rig's 0.7 m, then the camera rose to a half crouch and chest locks needed a real crouch (also in sitting mode). Now crouched and still for 0.3 s the camera goes to the rig's crouch height, moving takes it back to the sneak pose's eyes. Lower than the sneak pose (also the player's own head held low) the body gets smaller instead of pushing its feet into the floor. --- .../Scripts/Adapters/Player/VRHeroBody.cs | 57 +++++++++++++++++-- .../Adapters/Player/VrHeroLocomotion.cs | 6 ++ 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs b/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs index b713ff5bf..e28e5a42a 100644 --- a/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs +++ b/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs @@ -107,6 +107,13 @@ public class VRHeroBody : MonoBehaviour // Feet and toes - the floor under the sneak pose (the arms can reach lower). private readonly List _footBones = new(); private const string _sneakAnimation = "S_SNEAK"; + // Crouched and standing still for this long: the camera goes down to the rig's own crouch height (kneeling at + // a chest), moving takes it back up to the sneak pose's eyes. Short stops while walking don't bob the camera. + private const float _crouchStillDelay = 0.3f; + // The smallest body while crouched lower than the sneak pose (its feet stay on the floor). + private const float _minCrouchScale = 0.3f; + private float _lastCrouchMoveTime = float.NegativeInfinity; + private bool _isCrouchedStill; private SkinnedMeshRenderer _bodyRenderer; @@ -240,14 +247,15 @@ private void LateUpdate() var headHeight = head.position.y - feetY + Mathf.Max(0f, rig.StandingCameraHeight - rig.CameraHeight); _standingScale = Mathf.Clamp(headHeight / _modelHeadHeight, _minScale, _maxScale); } - var scale = _standingScale; + UpdateCrouchedStill(isCrouching); + var scale = GetCrouchScale(isCrouching, head.position.y - feetY); _body.transform.localScale = Vector3.one * scale; _body.transform.SetPositionAndRotation( new Vector3(head.position.x, feetY, head.position.z) - forward * (_torsoBackOffset * scale), Quaternion.LookRotation(forward)); _locomotion.Update(hero, _body.transform, rig, scale, isCrouching); - UpdateCrouchHeight(rig, scale); + UpdateCrouchHeight(rig, _standingScale); // The neck right under the goggles (and a bit behind them), whatever the model's root/bone layout or // animation pose is - sneaking leans the torso forward, it must not come into the view. @@ -261,9 +269,41 @@ private void LateUpdate() } /// - /// The crouch button takes the camera to the eyes of the sneak pose (S_SNEAK): lower, the neck under the - /// goggles pushed the body's feet into the floor. Measured from the body's own root once the pose is fully - /// blended in - whatever the camera does meanwhile. The first crouch of a body starts at the rig's own height. + /// Crouched without moving for _crouchStillDelay - the camera goes down to the rig's crouch height then. + /// + private void UpdateCrouchedStill(bool isCrouching) + { + if (!isCrouching || _locomotion.IsMoving) + _lastCrouchMoveTime = Time.time; + + var isCrouchedStill = Time.time - _lastCrouchMoveTime >= _crouchStillDelay; + if (isCrouchedStill == _isCrouchedStill) + return; + + _isCrouchedStill = isCrouchedStill; + Logger.Log(isCrouchedStill + ? "[VRHeroBody] Crouched and still - camera down to the rig's crouch height." + : "[VRHeroBody] Crouch ended or moving - camera at the sneak pose's eyes.", LogCat.VR); + } + + /// + /// Crouched lower than the sneak pose's eyes (standing still at the rig's crouch height, or the player's own + /// head held low): the body gets smaller, so its feet stay on the floor with the neck under the goggles. + /// + private float GetCrouchScale(bool isCrouching, float eyesAboveFeet) + { + if (!isCrouching || _sneakEyeHeight <= 0f) + return _standingScale; + + return Mathf.Clamp(eyesAboveFeet / _sneakEyeHeight, Mathf.Min(_minCrouchScale, _standingScale), + _standingScale); + } + + /// + /// The crouch button takes the camera to the eyes of the sneak pose (S_SNEAK) while moving: lower, the neck + /// under the goggles pushed the body's feet into the floor. Standing still, it goes down to the rig's own + /// crouch height (kneeling at a chest), the body shrinks to it (GetCrouchScale). Measured from the body's own + /// root once the pose is fully blended in - whatever the camera does meanwhile. scale: the standing scale. /// private void UpdateCrouchHeight(IVrRig rig, float scale) { @@ -286,6 +326,13 @@ private void UpdateCrouchHeight(IVrRig rig, float scale) if (_sneakEyeHeight < 0f) return; + if (_isCrouchedStill) + { + if (rig.CrouchHeightOverride.HasValue) + rig.CrouchHeightOverride = null; + return; + } + var height = _sneakEyeHeight * scale; if (!rig.CrouchHeightOverride.HasValue || Mathf.Abs(rig.CrouchHeightOverride.Value - height) > 0.01f) rig.CrouchHeightOverride = height; diff --git a/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs b/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs index 88ec2684c..21f7f8005 100644 --- a/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs +++ b/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs @@ -38,6 +38,11 @@ public class VrHeroLocomotion // every frame while it's missing (e.g. no S_SNEAKBL). Per built body (Bind). private readonly Dictionary<(string, string), string> _missingAnimationFallbacks = new(); + /// + /// The player moved (walk/run/sneak loop, not idle) in the last Update. + /// + public bool IsMoving { get; private set; } + /// /// The animator of a newly built body. /// @@ -70,6 +75,7 @@ public void Update(NpcContainer hero, Transform body, IVrRig rig, float scale, b var bodyState = _swimPose.GetBodyState(rig, hero.Props.BodyState); var isMoving = speed >= _idleSpeed; + IsMoving = isMoving; var isBackwards = local.z < -_backwardsShare * speed; var isTurning = Mathf.Abs(_bodyYawSpeed) >= _turnAnimationSpeed; From 4fec69c8dd6ec4fe091afd8bf798bd7fb35d0e0e Mon Sep 17 00:00:00 2001 From: BoroBongo Date: Sun, 22 Nov 2026 19:18:59 +0000 Subject: [PATCH 2/4] fix: crouched and standing still the hero kneels like at a chest in Gothic - the camera goes down to the kneel pose's eyes without shrinking the body Replaces the shrinking of the previous commit: crouched and still for 0.3 s the body plays S_CHESTSMALL_S0 (the hero's kneel at a chest, G1 and G2) and the camera goes to its eyes, 1.08 m at scale 1 (sneak pose: 1.40 m). Moving goes back to the sneak pose. Bodies without the kneel animation sneak. --- .../Scripts/Adapters/Player/VRHeroBody.cs | 107 ++++++++---------- .../Adapters/Player/VrHeroLocomotion.cs | 22 +++- 2 files changed, 67 insertions(+), 62 deletions(-) diff --git a/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs b/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs index e28e5a42a..7e72d8e2f 100644 --- a/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs +++ b/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs @@ -102,18 +102,17 @@ public class VRHeroBody : MonoBehaviour // Knocked out / dead / asleep body and camera (Accessibility option heroFallMode). private VrHeroDownPose _downPose; - // The eye height of the sneak pose at scale 1 (S_SNEAK, measured once per built body), -1 = not yet. + // The eye height of the sneak pose (S_SNEAK, 1.40 m in G1/G2) and the kneel pose (S_CHESTSMALL_S0, 1.08 m) + // at scale 1, measured once per built body, -1 = not yet. private float _sneakEyeHeight = -1f; + private float _kneelEyeHeight = -1f; // Feet and toes - the floor under the sneak pose (the arms can reach lower). private readonly List _footBones = new(); - private const string _sneakAnimation = "S_SNEAK"; - // Crouched and standing still for this long: the camera goes down to the rig's own crouch height (kneeling at - // a chest), moving takes it back up to the sneak pose's eyes. Short stops while walking don't bob the camera. - private const float _crouchStillDelay = 0.3f; - // The smallest body while crouched lower than the sneak pose (its feet stay on the floor). - private const float _minCrouchScale = 0.3f; + // Crouched and standing still for this long: the hero kneels (the camera goes down to the kneel pose's eyes, + // e.g. at a chest), moving takes him back to the sneak pose. Short stops while walking don't bob the camera. + private const float _kneelDelay = 0.3f; private float _lastCrouchMoveTime = float.NegativeInfinity; - private bool _isCrouchedStill; + private bool _isKneeling; private SkinnedMeshRenderer _bodyRenderer; @@ -247,15 +246,15 @@ private void LateUpdate() var headHeight = head.position.y - feetY + Mathf.Max(0f, rig.StandingCameraHeight - rig.CameraHeight); _standingScale = Mathf.Clamp(headHeight / _modelHeadHeight, _minScale, _maxScale); } - UpdateCrouchedStill(isCrouching); - var scale = GetCrouchScale(isCrouching, head.position.y - feetY); + var scale = _standingScale; _body.transform.localScale = Vector3.one * scale; _body.transform.SetPositionAndRotation( new Vector3(head.position.x, feetY, head.position.z) - forward * (_torsoBackOffset * scale), Quaternion.LookRotation(forward)); - _locomotion.Update(hero, _body.transform, rig, scale, isCrouching); - UpdateCrouchHeight(rig, _standingScale); + UpdateKneeling(isCrouching); + _locomotion.Update(hero, _body.transform, rig, scale, isCrouching, _isKneeling); + UpdateCrouchHeight(rig, scale); // The neck right under the goggles (and a bit behind them), whatever the model's root/bone layout or // animation pose is - sneaking leans the torso forward, it must not come into the view. @@ -269,75 +268,68 @@ private void LateUpdate() } /// - /// Crouched without moving for _crouchStillDelay - the camera goes down to the rig's crouch height then. + /// Crouched without moving for _kneelDelay: the hero kneels (VrHeroLocomotion.KneelAnimation). /// - private void UpdateCrouchedStill(bool isCrouching) + private void UpdateKneeling(bool isCrouching) { if (!isCrouching || _locomotion.IsMoving) _lastCrouchMoveTime = Time.time; - var isCrouchedStill = Time.time - _lastCrouchMoveTime >= _crouchStillDelay; - if (isCrouchedStill == _isCrouchedStill) + var isKneeling = Time.time - _lastCrouchMoveTime >= _kneelDelay; + if (isKneeling == _isKneeling) return; - _isCrouchedStill = isCrouchedStill; - Logger.Log(isCrouchedStill - ? "[VRHeroBody] Crouched and still - camera down to the rig's crouch height." - : "[VRHeroBody] Crouch ended or moving - camera at the sneak pose's eyes.", LogCat.VR); + _isKneeling = isKneeling; + Logger.Log(isKneeling + ? "[VRHeroBody] Crouched and still - the hero kneels." + : "[VRHeroBody] Crouch ended or moving - the hero sneaks/stands.", LogCat.VR); } /// - /// Crouched lower than the sneak pose's eyes (standing still at the rig's crouch height, or the player's own - /// head held low): the body gets smaller, so its feet stay on the floor with the neck under the goggles. - /// - private float GetCrouchScale(bool isCrouching, float eyesAboveFeet) - { - if (!isCrouching || _sneakEyeHeight <= 0f) - return _standingScale; - - return Mathf.Clamp(eyesAboveFeet / _sneakEyeHeight, Mathf.Min(_minCrouchScale, _standingScale), - _standingScale); - } - - /// - /// The crouch button takes the camera to the eyes of the sneak pose (S_SNEAK) while moving: lower, the neck - /// under the goggles pushed the body's feet into the floor. Standing still, it goes down to the rig's own - /// crouch height (kneeling at a chest), the body shrinks to it (GetCrouchScale). Measured from the body's own - /// root once the pose is fully blended in - whatever the camera does meanwhile. scale: the standing scale. + /// The crouch button takes the camera to the eyes of the body's pose: the sneak pose (S_SNEAK) while moving, + /// the kneel pose (S_CHESTSMALL_S0, e.g. at a chest) while standing still - lower, the neck under the goggles + /// pushed the body's feet into the floor. Each measured from the body's own root once the pose is fully + /// blended in - whatever the camera does meanwhile. The first crouch of a body starts at the rig's own height, + /// the first kneel at the sneak pose's. /// private void UpdateCrouchHeight(IVrRig rig, float scale) { if (_headBone == null || _animator == null || !_animator.IsValid) return; - if (_sneakEyeHeight < 0f && _animator.IsPlaying(_sneakAnimation) && _footBones.Count > 0) - { - // Like _modelHeadHeight: the head above the lowest foot bone, in the body's own units (scale 1) - the - // body's origin isn't at its feet. - var bodyTransform = _body.transform; - var lowestFoot = float.MaxValue; - foreach (var foot in _footBones) - lowestFoot = Mathf.Min(lowestFoot, bodyTransform.InverseTransformPoint(foot.position).y); - var headHeight = bodyTransform.InverseTransformPoint(_headBone.position).y - lowestFoot; - _sneakEyeHeight = headHeight + _neckBelowEyes; - Logger.Log($"[VRHeroBody] Sneak pose: eyes {_sneakEyeHeight:F2} m above the feet (scale 1) - the " + - "crouch button's camera height.", LogCat.VR); - } if (_sneakEyeHeight < 0f) - return; + _sneakEyeHeight = MeasureEyeHeight(VrHeroLocomotion.SneakAnimation, "Sneak"); + if (_kneelEyeHeight < 0f) + _kneelEyeHeight = MeasureEyeHeight(VrHeroLocomotion.KneelAnimation, "Kneel"); - if (_isCrouchedStill) - { - if (rig.CrouchHeightOverride.HasValue) - rig.CrouchHeightOverride = null; + var eyeHeight = _isKneeling && _kneelEyeHeight > 0f ? _kneelEyeHeight : _sneakEyeHeight; + if (eyeHeight < 0f) return; - } - var height = _sneakEyeHeight * scale; + var height = eyeHeight * scale; if (!rig.CrouchHeightOverride.HasValue || Mathf.Abs(rig.CrouchHeightOverride.Value - height) > 0.01f) rig.CrouchHeightOverride = height; } + /// + /// The eyes above the lowest foot bone while the pose is fully blended in, in the body's own units (scale 1) - + /// the body's origin isn't at its feet. -1 while the pose doesn't play. + /// + private float MeasureEyeHeight(string animation, string poseName) + { + if (!_animator.IsPlaying(animation) || _footBones.Count == 0) + return -1f; + + var bodyTransform = _body.transform; + var lowestFoot = float.MaxValue; + foreach (var foot in _footBones) + lowestFoot = Mathf.Min(lowestFoot, bodyTransform.InverseTransformPoint(foot.position).y); + var eyeHeight = bodyTransform.InverseTransformPoint(_headBone.position).y - lowestFoot + _neckBelowEyes; + Logger.Log($"[VRHeroBody] {poseName} pose ({animation}): eyes {eyeHeight:F2} m above the feet (scale 1) " + + "- the crouch button's camera height.", LogCat.VR); + return eyeHeight; + } + private void SolveArms() { GetSecondHandGripPoses(out var leftGrip, out var rightGrip); @@ -430,6 +422,7 @@ private void EnsureBody(NpcContainer hero) _renderers.Clear(); _bodyRenderer = null; _sneakEyeHeight = -1f; + _kneelEyeHeight = -1f; _footBones.Clear(); _sleeves.Clear(); diff --git a/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs b/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs index 21f7f8005..ada51d01b 100644 --- a/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs +++ b/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs @@ -38,6 +38,13 @@ public class VrHeroLocomotion // every frame while it's missing (e.g. no S_SNEAKBL). Per built body (Bind). private readonly Dictionary<(string, string), string> _missingAnimationFallbacks = new(); + /// + /// Crouched and standing still: the hero kneels like at a chest in Gothic (G1/G2 HUMANS.MDS). Bodies without + /// it sneak (S_SNEAK). + /// + public const string KneelAnimation = "S_CHESTSMALL_S0"; + public const string SneakAnimation = "S_SNEAK"; + /// /// The player moved (walk/run/sneak loop, not idle) in the last Update. /// @@ -54,9 +61,11 @@ public void Bind(VRHeroBodyAnimator animator) /// /// Picks and plays this frame's animation and advances the animator. body: the placed body (its yaw and - /// facing), scale: its scale (the walk/run loops' real speed). + /// facing), scale: its scale (the walk/run loops' real speed), isKneeling: crouched and standing still for a + /// moment (VRHeroBody) - the kneel pose instead of the sneak pose. /// - public void Update(NpcContainer hero, Transform body, IVrRig rig, float scale, bool isCrouching) + public void Update(NpcContainer hero, Transform body, IVrRig rig, float scale, bool isCrouching, + bool isKneeling) { if (_animator == null || !_animator.IsValid) return; @@ -81,7 +90,8 @@ public void Update(NpcContainer hero, Transform body, IVrRig rig, float scale, b var animation = _swimPose.GetAnimation(_animator, bodyState, speed, isMoving, isBackwards, isTurning, _bodyYawSpeed < 0f) - ?? GetWalkAnimation(rig, velocity, speed, local, isMoving, isBackwards, isTurning, isCrouching); + ?? GetWalkAnimation(rig, velocity, speed, local, isMoving, isBackwards, isTurning, isCrouching, + isKneeling); if (!_animator.HasAnimation(animation)) { @@ -127,13 +137,15 @@ private string GetMissingAnimationFallback(string animation) /// On land: falling, sneaking, idle/turning on the spot, walking backwards, strafing, walking/running. /// private string GetWalkAnimation(IVrRig rig, Vector3 velocity, float speed, Vector3 local, bool isMoving, - bool isBackwards, bool isTurning, bool isCrouching) + bool isBackwards, bool isTurning, bool isCrouching, bool isKneeling) { if (rig != null && !rig.IsGrounded && velocity.y < -1f && !_swimPose.IsInWater && _animator.HasAnimation(_fallAnimation)) return _fallAnimation; + if (isCrouching && !isMoving) + return isKneeling && _animator.HasAnimation(KneelAnimation) ? KneelAnimation : SneakAnimation; if (isCrouching) - return !isMoving ? "S_SNEAK" : isBackwards ? "S_SNEAKBL" : "S_SNEAKL"; + return isBackwards ? "S_SNEAKBL" : "S_SNEAKL"; if (!isMoving) return isTurning ? (_bodyYawSpeed < 0f ? "T_RUNTURNL" : "T_RUNTURNR") : _idleAnimation; if (isBackwards) From 70edd213590dc6bae75a69f45e5b0ba99d7d5b90 Mon Sep 17 00:00:00 2001 From: BoroBongo Date: Sun, 22 Nov 2026 19:19:39 +0000 Subject: [PATCH 3/4] fix: the hero kneels after 1 s of standing still while crouched (moving sneaks again at once) --- Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs b/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs index 7e72d8e2f..eb3c7e915 100644 --- a/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs +++ b/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs @@ -110,7 +110,7 @@ public class VRHeroBody : MonoBehaviour private readonly List _footBones = new(); // Crouched and standing still for this long: the hero kneels (the camera goes down to the kneel pose's eyes, // e.g. at a chest), moving takes him back to the sneak pose. Short stops while walking don't bob the camera. - private const float _kneelDelay = 0.3f; + private const float _kneelDelay = 1f; private float _lastCrouchMoveTime = float.NegativeInfinity; private bool _isKneeling; From 747c40f75992c5de62efbd0538f0ebe1498b5879 Mon Sep 17 00:00:00 2001 From: BoroBongo Date: Sun, 22 Nov 2026 19:24:44 +0000 Subject: [PATCH 4/4] fix: kneeling holds through a short push of the body capsule - it ends after 0.15 s of real movement (the thumbstick), so leaning the head into a chest doesn't take the camera up at its lock --- .../Scripts/Adapters/Player/VRHeroBody.cs | 21 +++++++++++++++++-- .../Adapters/Player/VrHeroLocomotion.cs | 3 ++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs b/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs index eb3c7e915..4c0c13d04 100644 --- a/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs +++ b/Assets/Gothic-VR/Scripts/Adapters/Player/VRHeroBody.cs @@ -111,7 +111,11 @@ public class VRHeroBody : MonoBehaviour // Crouched and standing still for this long: the hero kneels (the camera goes down to the kneel pose's eyes, // e.g. at a chest), moving takes him back to the sneak pose. Short stops while walking don't bob the camera. private const float _kneelDelay = 1f; + // Kneeling ends after moving this long without a break: the thumbstick does that at once, a push of the body + // capsule (the head leant into the chest) doesn't take the camera up 30 cm at the lock. + private const float _standUpDelay = 0.15f; private float _lastCrouchMoveTime = float.NegativeInfinity; + private float _movingSince = -1f; private bool _isKneeling; private SkinnedMeshRenderer _bodyRenderer; @@ -268,11 +272,24 @@ private void LateUpdate() } /// - /// Crouched without moving for _kneelDelay: the hero kneels (VrHeroLocomotion.KneelAnimation). + /// Crouched without moving for _kneelDelay: the hero kneels (VrHeroLocomotion.KneelAnimation). Head movement + /// doesn't count (the body capsule follows the head without moving), only the thumbstick/teleport, and while + /// kneeling only after _standUpDelay of it. /// private void UpdateKneeling(bool isCrouching) { - if (!isCrouching || _locomotion.IsMoving) + if (_locomotion.IsMoving) + { + if (_movingSince < 0f) + _movingSince = Time.time; + } + else + { + _movingSince = -1f; + } + + var isStandingUp = _movingSince >= 0f && (!_isKneeling || Time.time - _movingSince >= _standUpDelay); + if (!isCrouching || isStandingUp) _lastCrouchMoveTime = Time.time; var isKneeling = Time.time - _lastCrouchMoveTime >= _kneelDelay; diff --git a/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs b/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs index ada51d01b..424ed7e95 100644 --- a/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs +++ b/Assets/Gothic-VR/Scripts/Adapters/Player/VrHeroLocomotion.cs @@ -142,7 +142,8 @@ private string GetWalkAnimation(IVrRig rig, Vector3 velocity, float speed, Vecto if (rig != null && !rig.IsGrounded && velocity.y < -1f && !_swimPose.IsInWater && _animator.HasAnimation(_fallAnimation)) return _fallAnimation; - if (isCrouching && !isMoving) + // Kneeling holds the pose through a short push (VRHeroBody ends it once the player really moves). + if (isCrouching && (isKneeling || !isMoving)) return isKneeling && _animator.HasAnimation(KneelAnimation) ? KneelAnimation : SneakAnimation; if (isCrouching) return isBackwards ? "S_SNEAKBL" : "S_SNEAKL";