RealDocs

AActor::IsActorOrSelectionParentSelected

function Engine Since 4.20
#include "GameFramework/Actor.h"
Access: public Specifiers: ENGINE_APIconst

Description

Returns true if this actor or any of its selection parents are currently selected in the editor. Useful for rendering or logic that should activate for any member of a selected group.

Caveats & Gotchas

  • This walks the selection parent chain and checks IsSelected() at each level — in deep hierarchies this can be slower than a direct IsSelected() call. Cache the result if calling it frequently.
  • Only meaningful in editor builds — at runtime in a shipped game, selection state does not exist and this will always return false.
  • If GetRootSelectionParent() creates a cycle (due to a buggy override), this function will spin indefinitely. Ensure selection parent chains are acyclic.

Signature

ENGINE_API bool IsActorOrSelectionParentSelected() const

Return Type

bool

Example

Highlight group members when any parent is selected C++
void AMyChildActor::UpdateEditorHighlight()
{
    bool bShouldHighlight = IsActorOrSelectionParentSelected();
    SetActorHiddenInGame(!bShouldHighlight); // Simple highlight approximation
}

Version History

Introduced in: 4.20

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.