RealDocs

AActor::GetActorEnableCollision

function Engine Blueprint Since 4.0
#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
Event BeginPlay Branch Condition Condition True False Set Actor Enable Collision Target is Actor Target New Actor Enable Collision New Actor Enable Collision true true Get Actor Enable Collision Target is Actor Return Value
Edit Blueprint graph Re-enable collision on BeginPlay if it was previously disabled
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
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);
}

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.