UKismetSystemLibrary::GetComponentBounds
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Computes the world-space bounding box and sphere for a single scene component, including its attached children.
Caveats & Gotchas
- • Bounds include attached child components, so results can be larger than the component's own primitive if children are attached to it.
- • For actor-wide bounds across all components, use GetActorBounds instead — this only covers the one component's subtree.
- • Passing a null Component returns zeroed-out bounds rather than asserting.
Signature
static void GetComponentBounds(const USceneComponent* Component, FVector& Origin, FVector& BoxExtent, float& SphereRadius) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Component | const USceneComponent* | The component to compute bounds for. | — |
| Origin | FVector& | Output: world-space center of the bounding box. | — |
| BoxExtent | FVector& | Output: half-size of the bounding box along each axis. | — |
| SphereRadius | float& | Output: radius of the bounding sphere that encloses the box. | — |
Return Type
void Example
Get world bounds of a component C++
FVector Origin, BoxExtent;
float SphereRadius;
UKismetSystemLibrary::GetComponentBounds(MyMeshComponent, Origin, BoxExtent, SphereRadius); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?