ACharacter::CrouchedEyeHeight
#include "GameFramework/Character.h"
Access: public
Specifiers: UPROPERTYEditAnywhereBlueprintReadWrite
Description
The eye height (in unscaled units from the bottom of the capsule) used when the character is crouched. The player controller and camera manager use this value to position the view.
Caveats & Gotchas
- • This value is in capsule-local space, measured from the capsule's base, not from its center. Setting it to match `CapsuleHalfHeight` when crouched places the eye at the top of the capsule — generally too high.
- • The default value is 32 units (half of a typical crouched capsule half-height of 40). If you change the crouched capsule half-height in `CharacterMovement->CrouchedHalfHeight`, you should update this property to match your design intent.
- • Camera managers read this value during `CalcCamera` on the player controller. Third-person cameras that don't use the built-in eye height system won't automatically respond to this property — you must manually interpolate to the crouched camera position in your own camera logic.
Signature
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Camera)
float CrouchedEyeHeight Examples
Set CrouchedEyeHeight on BeginPlay for a custom crouch capsule
Blueprint
Set crouched eye height to match a custom capsule size C++
AMyCharacter::AMyCharacter()
{
// Crouched half-height is 50 units, so center is at 50. Eye is near top.
GetCharacterMovement()->CrouchedHalfHeight = 50.f;
CrouchedEyeHeight = 40.f; // 40 units from capsule base
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?