In Realistic FPS Prefab v1.21 (by Azuline Studios), when you stand from a crouch, the player’s collider immediately expands vertically from the crouched height to the standing height. This puts a lot of downward force under the player, which can have an interesting effect if you’re standing on top of another physics object. Since the physics object has a rigidbody, you get an equal and opposite upward force, jettisoning the player into the air.
If you want to fix it, edit FPSRigidbodyWalker.cs. Around line 880, in the “//Crouching & Prone” section of FixedUpdate(), change this line:
capsule.height = standingCapsuleheight;
to this:
if (capsule.height < standingCapsuleheight) { if (Physics.Raycast(myTransform.position, -myTransform.up, out rayHit, rayCastHeight, clipMask.value) && (rayHit.collider.GetComponent<Rigidbody>() != null)) { capsule.height = Mathf.Min(capsule.height + 4 * Time.deltaTime, standingCapsuleheight); } else { capsule.height = standingCapsuleheight; } }
This code change checks if you’re standing up while on a rigidbody. If so, you’ll stand up more slowly to reduce the upward force from the rigidbody.