Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Virtual bones issues when loading skeletalmesh at runtime

Hi all !

I'm facing a very disturbing issue in the builds of our multiplayer game :

we have a class base on Character that contains a few components, including a third person mesh component (the game is first person, so this is used to show the player where it is not locally controlled)

In the constructor this mesh component has no skeletal mesh set, and no animation class set. The meshes are stored in an array so we can choose which one we apply

from ACharacterBase.h :

     TArray<USkeletalMesh*> ThirdPersonMeshes;

At run time, I then set the mesh and the animation class :

 void ACharacterBase::LoadSkin() {
     uint8 SkinId = GetPlayerState()->SkinId;
     check(ThirdPersonMeshes.Num() >= SkinId);
     USkeletalMeshComponent* ThirdPersonMesh = GetMesh();
     ThirdPersonMesh->SetSkeletalMesh(ThirdPersonMeshes[SkinId - 1]);
     ThirdPersonAnimClass = ThirdPersonAnimationClass[SkinId - 1];
     // actually we use a short timer to make sure the mesh has been set properly otherwise we get a few warnings
     // but i didn't want to add unneeded details

We do this only once after some initialization, and we never change it afterwards.

In PIE this works fine, but when I cook my content, virtual bones don't work anymore : instead of following the bones they're related to, they are stuck at the origin point of the skeleton

This is not always happening, and it's triggered by stuff totally unrelated (like adding a certain call in the level BP), but this seems very related to the fact that we set the skeletal mesh at runtime, after initialization.

I'm going to dig into the engine code, but if any of you have an idea about where this could come from, or if it is a known bug, tell me !

Product Version: UE 4.20
more ▼

asked May 22 '19 at 10:33 AM in C++ Programming

avatar image

82 1 4 6

avatar image developpeur2000 May 22 '19 at 01:09 PM

So after some digging, I found the following :

the problem arise before my LoadSkin method, when the ThirdPersonMeshes property is initialized from serialized data

in the PIE case everything goes fine, the RefSkeleton of the mesh is correctly set and I get my raw bones and virtual bones indexed

in the cooked build, the virtual bones are absent, so it seems there were not serialized, although there was no warning during the cooking

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I can now confirm that the RefSkeleton is not serialized properly when cooked. The Skeleton is correct though, so I can fix my issue by rebuilding the RefSkeleton from the skeleton, but this comes from a bug from the engine / editor

It's not always, and it's triggered by totally unrelated modifications on the project, but once we are in a configuration that leads to this, every build will have the problem

more ▼

answered May 22 '19 at 01:53 PM

avatar image

82 1 4 6

avatar image developpeur2000 May 22 '19 at 02:20 PM

this seems to be caused by issue https://issues.unrealengine.com/issue/UE-66234

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question