RealDocs

ACharacter::RecalculateBaseEyeHeight

function Engine Since 4.0
#include "GameFramework/Character.h"
Access: public Specifiers: virtualoverride

Description

Updates `BaseEyeHeight` to account for the Character's current posture (standing or crouched). Called automatically by CharacterMovementComponent whenever crouch state changes.

Caveats & Gotchas

  • ACharacter's implementation sets BaseEyeHeight to `CrouchedEyeHeight` when crouching and back to the default when standing — override this if you have additional postures (e.g. prone) that need a different eye height.
  • The change only affects `BaseEyeHeight` (used by camera and first-person logic); it does not move the capsule or mesh — those are handled separately by OnStartCrouch/OnEndCrouch.

Signature

ENGINE_API virtual void RecalculateBaseEyeHeight() override;

Return Type

void

Example

Override to support a prone eye height C++
void AMyCharacter::RecalculateBaseEyeHeight()
{
    Super::RecalculateBaseEyeHeight();
    if (bIsProne)
    {
        BaseEyeHeight = ProneEyeHeight;
    }
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.