Issue with Virtual Bones Not Recognized in Unreal Engine Skeletal Mesh

Hello Unreal Community,

I’m encountering a recurring issue with my Unreal Engine project where virtual bones in my skeletal mesh are not being recognized intermittently. This problem started unexpectedly yesterday, even though I was working on a completely unrelated feature. I primarily use a virtual bone to attach my camera.

Problem Description:
While everything was functioning correctly before, the virtual bones now seem to sporadically fail to be recognized. For instance, when I use the GetAllSocketNames() function, it does not list any of the virtual bone sockets. However, if I manually rename the virtual bone in the skeleton editor and then play, it recognizes the bone but the camera attached to it exhibits a strange shaking behavior.

Steps to Reproduce:

  1. Start the game.
  2. Virtual bones are not recognized (no listing with GetAllSocketNames()).
  3. Rename virtual bone to the same name in the skeleton editor.
  4. Play the game - the virtual bone works but the camera shakes.

Code Snippet:
void ACharPlayerBaseCharacter::BeginPlay()
{
Super::BeginPlay();

const FCharBaseData CharData = CharacterDataAsset->Character1PData;
ArmsMesh1P->SetSkeletalMesh(CharData.SkeletalMesh);
if (ArmsMesh1P && ArmsMesh1P->GetSkinnedAsset())
{
	const FName SocketCameraFPSAnimated = FName("VB head_root");
	TArray<FName> SocketNames = ArmsMesh1P->GetAllSocketNames();
	if (ArmsMesh1P->DoesSocketExist(SocketCameraFPSAnimated))
	{
		SceneCamera1P->AttachToComponent(ArmsMesh1P, FAttachmentTransformRules::SnapToTargetNotIncludingScale, SocketCameraFPSAnimated);
	}
}

}

Additional Context:

  • The issue started without any recent changes to related code or assets.
  • Restarting the IDE and rebuilding the project temporarily fixed the problem the first time, but after some minutes it stopped again.

Any insights or suggestions on what might be causing this issue or how to resolve it would be greatly appreciated. Thank you in advance for your help!

Additionally, I’ve noticed another peculiar issue related to the Timeline node graph keys; they get deleted randomly when this problem occurs. As mentioned earlier, my setup has been stable and functioning well for several months. However, these issues began shortly after I updated to Unreal Engine 5.4.

I have attempted troubleshooting steps such as deleting the skeletal mesh and reimporting it. This solution seemed effective for about 30 minutes, but then the problem resurfaced randomly.

Has anyone else experienced similar issues after updating to UE 5.4? Any suggestions on stable configurations or workarounds would be greatly appreciated. Thank you for any assistance!

1 Like