RealDocs

AActor::GetSimpleCollisionHalfHeight

function Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: inline

Description

Returns just the half-height component of GetSimpleCollisionCylinder(). Convenience wrapper when only vertical extent is needed.

Caveats & Gotchas

  • Calls GetSimpleCollisionCylinder() internally and discards the radius. If you also need the radius, call GetSimpleCollisionCylinder() once instead of both convenience getters.
  • Half-height is measured from the actor's pivot — which may not be at the base of the collision cylinder. Account for the actor's Z location when computing ground clearance.

Signature

float GetSimpleCollisionHalfHeight() const

Return Type

float

Example

Estimate top of actor for line-of-sight traces C++
float HalfHeight = GetSimpleCollisionHalfHeight();
FVector TopOfActor = GetActorLocation() + FVector(0.f, 0.f, HalfHeight);
// Trace from eye to the top of the target
GetWorld()->LineTraceSingleByChannel(HitResult, EyeLocation, TopOfActor, ECC_Visibility, Params);

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.