AActor::IsRootComponentCollisionRegistered
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtualconst
Description
Returns true when the actor's root component is registered with the world and has collision enabled. Used internally to decide whether GetSimpleCollisionCylinder can short-circuit to the root component's bounds.
Caveats & Gotchas
- • Returns false for actors whose root component is a SceneComponent with no collision (e.g. a pure-transform root), even if child primitive components have collision enabled.
- • The result can change at runtime whenever SetRootComponent() is called or a component's collision is toggled — do not cache the return value across frames.
Signature
virtual bool IsRootComponentCollisionRegistered() const Return Type
bool Example
Guard before using root-component bounds C++
if (MyActor->IsRootComponentCollisionRegistered())
{
float Radius, HalfHeight;
MyActor->GetSimpleCollisionCylinder(Radius, HalfHeight);
}
else
{
// Fallback: iterate all components
float Radius, HalfHeight;
MyActor->GetComponentsBoundingCylinder(Radius, HalfHeight);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?