RealDocs

AActor::GetAttachParentSocketName

function Engine Blueprint Since 4.11
#include "GameFramework/Actor.h"
Access: public Specifiers: UFUNCTIONBlueprintPure

Description

Walks up the attachment chain from RootComponent and returns the socket name on the parent actor's component to which this actor is attached. Returns NAME_None if this actor is not attached to a component in a different actor.

Caveats & Gotchas

  • Returns NAME_None both when there is no attachment and when the actor is attached directly to the component root (no specific socket). Always pair with GetAttachParentActor() to distinguish these cases.
  • The socket name is determined by the component the RootComponent is attached to — if intermediate attachments exist within the same actor, those socket names are not returned, only the one at the cross-actor boundary.
  • Socket names are FName comparisons; use == NAME_None rather than IsNone() for clarity, though both work.

Signature

ENGINE_API FName GetAttachParentSocketName() const

Return Type

FName

Example

Log the socket name when this actor is attached C++
void AWeaponActor::OnEquipped()
{
	FName SocketName = GetAttachParentSocketName();
	if (SocketName != NAME_None)
	{
		UE_LOG(LogTemp, Log, TEXT("Attached to socket: %s"), *SocketName.ToString());
	}
}

Version History

Introduced in: 4.11

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.