[BUG] Sockets don't scale correctly with negative values

Hi,

I have a weapon class actor which has two SkeletalMesh components:

  • Arm

  • Weapon

The Arm is attached to the rootcomponent, and the weapon is attached to the arm.
Now, this class can be spawned as either left or right handed.
When it’s spawned as left handed, I simply multiply this weapon actor’s scale on the Y-axis by -1.0f.
The arms scale perfectly and are nice and symmetric with all animations working fine, however the weapon mesh, which is attached to the arm mesh via a socket does not scale correctly. There’s something funky going on there.

I’ve tried scaling the components as opposed to the whole actor, but get the same results.
Please see the screenshot below:

Really, no-one has encountered this before?

#SceneComponent-> Set Relative Scale 3D

Have you tried setting the relative scale of the attached component yourself?

see scenecomponent.h !

FVector RelativeScale3D //var
SetRelativeScale3D() //func

you most likely want this one as it will preserve its current socket scaling, but apply any changes you want!

#C++ Code For You!

basic code

if(SwordComp)
{
    //Get
    FVector SwitchedY = SwordComp->RelativeScale3D;
    
    //Modify
    SwitchedY.Y *= -1;
    
    //Set
    SwordComp->SetRelativeScale3D(SwitchedY);
}

Enjoy!

Hi ,

Thanks very much for the reply, but I’ve unfortunately already tried that without success.

Can’t figure out why this would be happening.
The terrible thing is, if I don’t get this approach working, I will have to physically duplicate the mesh and all animations and flip them outside of UE, import all of them and duplicate all the weapon code. That would really suck.

Cheers.

I’ve sent out some emails to Epic about your issue, I hope Epic gets back to you!

Thanks very much - you are a legend as usual.
Cheers!

Hee hee!

Hopefully they get back to you on Monday!

Bump. I would really appreciate it if someone from Epic could have a look at this one please. Thanks.

Bump again. Still nothing?

Still nothing still?

Bumpercars anyone?

I’m gonna email this around again and see what happen

Thanks , much appreciated again!

Bumpaddle?

Pinging my posterior - bum ping?

Epic has informed me they will be getting to your question soon / are reviewing it now!

#:heart:

Hi staticvoidlol,

Sorry for missing this post. This is an issue that we have been looking into for a while. Unfortunately we do not currently have a solution or workaround for it, and we cannot provide any estimates regarding when we will have a solution. For now, we recommend not mirroring skeletal meshes this way.

, thanks very much for all your input on this one, it is much appreciated. Keep fighting the good fight!

Hi ,

Thanks very much for getting back to me on this one, I can only imagine how busy you guys are.

This is however quite unfortunate news, as this has a significant impact on both the workflow (having to duplicate and mirror the components and animations) as well as the weapon code architecture.

I’ll start some diabolic rituals involving large amounts of chanting and/or cat blood so long and hope for the best.

Cheers,
staticvoidlol

Hi ,

Any update on this one?

This is a really troubling issue, as the workaround would be to physically duplicate and mirror all assets in external software.

Thanks.