ACharacter::RecalculateCrouchedEyeHeight
#include "GameFramework/Character.h"
Access: public
Specifiers: ENGINE_API
Description
Recomputes the camera/eye height offset for the crouched state from the CharacterMovementComponent settings. Called automatically during crouch/uncrouch transitions.
Caveats & Gotchas
- • The result is stored in CrouchedEyeHeight, which is used by the camera manager to position the viewpoint. If you change CrouchedHalfHeight on the movement component at runtime, call this function afterward to keep the eye height in sync.
- • This is not virtual and has no Blueprint exposure. Customizing crouch eye height requires either changing the movement component values before the recalculation or post-adjusting CrouchedEyeHeight manually.
Signature
ENGINE_API void RecalculateCrouchedEyeHeight(); Return Type
void Example
Update eye height after modifying crouch height at runtime C++
void AMyCharacter::SetCustomCrouchHeight(float NewHalfHeight)
{
GetCharacterMovement()->CrouchedHalfHeight = NewHalfHeight;
RecalculateCrouchedEyeHeight();
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?