Socket Local Rotation

You can’t achieve this only in BP, but it’s easy in Cpp : in a library class you just have to add :

library.h

UFUNCTION(BlueprintCallable, BlueprintPure, Category = "LibraryC")
static void GetSocketLocalLocRot(const USkeletalMeshComponent* Mesh, FVector& LocalLocation, FRotator& LocalRotation, FName SocketName);

Library.cpp

void YourLibraryClass::GetSocketLocalLocRot(const USkeletalMeshComponent* Mesh, FVector& LocalLocation, FRotator& LocalRotation, FName SocketName)
{
	FTransform LocalTransform = Mesh->GetSocketTransform(SocketName, RTS_Component);
	LocalLocation = LocalTransform.GetLocation();
	LocalRotation = LocalTransform.Rotator();
}

And you can use it in any blueprint :wink:

Hey,

Is there any way to get a skeletal mesh socket’s local rotation? I want to get a bone’s relative rotation, rather than world. If I can get the bone rotation directly, rather than socket, that’s fine too.

Rama used to have it in his plugin but looks like epic removed the GetSocketLocalTransform command.

Works amazingly. Thanks so much!

This should already be possible by calling GetSocketTransform (which is expose to BP) on the component.

1 Like