RealDocs

AActor::GetSelectionParent

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

Description

Returns the immediate parent actor in the editor selection hierarchy. Used by the editor to redirect selection from a child actor to its selection parent.

Caveats & Gotchas

  • The default implementation returns nullptr. If IsSelectionChild() returns true, this should return a valid actor — an inconsistency between the two will produce broken editor selection.
  • This returns the *immediate* parent, not the root. Use GetRootSelectionParent() if you need the top of the selection chain.
  • Changes to this return value are not reflected in the editor selection until the next selection operation — there is no live update mechanism.

Signature

ENGINE_API virtual AActor* GetSelectionParent() const

Return Type

AActor*

Example

Return the owning group actor as selection parent C++
AActor* AMyChildActor::GetSelectionParent() const
{
    return Cast<AActor>(GetOwner());
}

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.