Download

Changing SkeletalMesh Componenmts in runtime giving issues.

Hello,

I am having a strange problem. I have created a skeletal mesh having several clothing components who share the same animation blueprint , contained within the character blueprint. So at the beginning of the game , I can decide which set of clothes the actor should wear and set the respective asset accordingly, as shown below, which works perfect.

Capture.JPG

Below is the result of clothing combination , which is perfectly in sync with the animationset , and showing no error.

Capture.JPG

However, I want to change clothes in runtime. So I walk up to the wardrobe, select a cloth, and hit equip, as shown below :

Capture.JPG

So in the wardrobe inventory widget I am calling the character class clothing variable and changing its skeletalmesh value, as shown below:

Capture.JPG

But this is giving very bad result. The cloth and the mesh is not in sync, as seen below:

Capture.JPG

I don’t understand. The same code is getting executed both the time. Also I have tested with all the clothing meshes at the beginning of play, and they are perfectly in sync at that time. Kindly help.

Are all your mesh/cloth components “anim parented” to the same single Mesh?
On working with modular characters to avoid parts losing sync the ideal is that just one from your components controls the animation.

Give a look by “Modular Character” on docs and you’ll probably get both C++ and Blueprint ways to do this.

Hope this helps. :wink:

here is the node to assign the “MASTER” animated component that will drive all others:
https://docs.unrealengine.com/latest/INT/BlueprintAPI/Components/SkinnedMesh/SetMasterPoseComponent/index.html

You are a life saver , genius. It is working flawlessly now.
Just one concern though, in the begin play also I am not setting master component explicitly. But that time it is working fine. Why do I need to do this in the middle of the play and not in the beginning of the play?

This looks great but how do I match the clothes with the person I bought like jeans shirts boots etc how do I get the to fit the person before I set this up that’s the huge problem I am having hope to hear from you soon