RealDocs

ACharacter::GetSimpleCollisionCylinder

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

Description

Returns the radius and half-height of the character's capsule component, used as the simplified collision shape. Overrides AActor's version to read directly from the CapsuleComponent.

Caveats & Gotchas

  • Returns the unscaled capsule dimensions; if the capsule's world scale is not (1,1,1) the values will not reflect the actual world-space extents — multiply by the component's scale yourself if needed.
  • If the CapsuleComponent has been replaced or detached at runtime, the values returned may be defaults (0, 0) or garbage; ensure the capsule is valid before relying on this in derived classes.

Signature

virtual void GetSimpleCollisionCylinder(float& CollisionRadius, float& CollisionHalfHeight) const override

Parameters

Name Type Description Default
CollisionRadius float& Output: radius of the capsule used for simple collision.
CollisionHalfHeight float& Output: half-height of the capsule used for simple collision.

Return Type

void

Example

Reading capsule size for a proximity check C++
float Radius, HalfHeight;
MyCharacter->GetSimpleCollisionCylinder(Radius, HalfHeight);
// Use Radius to offset a trace start point
FVector TraceStart = MyCharacter->GetActorLocation() + FVector(0.f, 0.f, HalfHeight);

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.