How do I get the name of the bone a scene component is attached to?

I believe you are looking for AttachSocketName in USceneComponent (third variable.) This is the way you access it through C++.

Unfortunately this variable is not exposed through blueprint. You’ll have to implement some way to retrieve it yourself.

Example Solution


#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "Components/SceneComponent.h"
#include "MyBlueprintFunctionLibrary.generated.h"

class MY_GAME_API UMyBlueprintFunctionLibrary
	: public UBlueprintFunctionLibrary {
	UFUNCTION(Category="MyCategory", BlueprintCallable)
	static FName GetSceneComponentAttachSocketName(USceneComponent* SceneComponent);


FName UBasics::GetSceneComponentAttachSocketName(USceneComponent* SceneComponent) {
	return SceneComponent->AttachSocketName;

Blueprint Usage

After compiling it should look something similar to this. Good luck!

I have an actor containing a skeletal mesh, this skeletal mesh has a scene component socketed to the bone “hand_r”. How can the scene component get the name “hand_r” in this scenario?

“Get Attach Parent”, I believe, gives me the skeletal mesh but I need a reference to the bone or just the name of it.