APawn::GetDefaultHalfHeight
#include "GameFramework/Pawn.h"
Access: public
Specifiers: virtual
Description
Returns the half-height of the default collision shape for this pawn, scaled by the root component's world scale. By default queries the RootComponent regardless of whether it is registered or collidable.
Caveats & Gotchas
- • The base APawn implementation returns the half-height from the RootComponent directly; ACharacter overrides this to return the capsule half-height from the CapsuleComponent, so the return value depends heavily on which class you call it on.
- • The value is affected by the component's world scale — if you've scaled the pawn non-uniformly, this may not reflect the actual navigable half-height. Use GetNavAgentPropertiesRef() for navigation-aware sizing.
Signature
ENGINE_API virtual float GetDefaultHalfHeight() const; Return Type
float Example
Compute the eye trace start height above the ground C++
float HalfHeight = GetDefaultHalfHeight();
FVector GroundPos = GetActorLocation() - FVector(0.f, 0.f, HalfHeight);
FVector EyePos = GroundPos + FVector(0.f, 0.f, BaseEyeHeight); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?