AActor::GetActorEnableCollision
#include "GameFramework/Actor.h"
Access: public
Specifiers: UFUNCTIONBlueprintPure
Description
Returns whether collision is currently enabled for the whole actor. Reflects the state set by SetActorEnableCollision(), not individual component settings.
Caveats & Gotchas
- • This returns the actor-level collision flag only — individual components can still have collision disabled independently. An actor with GetActorEnableCollision()==true may still have components with no collision.
- • Enabling actor collision does not restore per-component collision responses that were already disabled before the actor-level flag was set.
Signature
bool GetActorEnableCollision() const Return Type
bool Examples
Re-enable collision on BeginPlay if it was previously disabled
Blueprint
Check before performing collision-dependent logic C++
if (MyActor->GetActorEnableCollision())
{
// Safe to rely on blocking hits from this actor
FHitResult Hit;
MyActor->ActorLineTraceSingle(Hit, Start, End, ECC_Visibility, Params);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?