Cannot understand the rotation of a mesh attached to the socket of a scaled mesh (Z -1)

Hello,

I’m working on a VR prototype using the “Virtual Reality” template and I’m stuck with an issue. In the template there is only one hand skeletal mesh, which is scaled -1 on the Z axis in the left-hand-BP. For me this is very convenient because I can use the same skeleton and animations for both hands. But when I attach an object to the left hand the rotation is always wrong.


The skeleton has a socket per object

The solution I was thinking of is to find the “equation” to compensate the rotation. I thought using an InverseTransformRotator would do it but no, I can’t figure out the math.

What would you suggest me to do ?

Thanks,

Jérémie

Update

I tried to mirror the mesh in Blender and export the Skeleton and The SK Mesh as LeftHand and I have some a very weird bugs:
20190618-23_00_00Start.jpgIn the Physics Asset the collisions looks alright

But in the Scene, with the collision debug, it’s all messed up
And it’s the same with the sockets
20190618-23_02_21Start.png In the Skeleton editor
In the scene

:frowning: :frowning: :frowning: WHY !?

so, Z -1 is essentially X + 180, z +180. Not exactly, but for the purpose of the socket it should be.
Depending on the Left or Right hand coordinate system, for unreal it should be X dominant and Z vertical (right hand).

Though, I’m not familiar with the template or it’s instancing, it looks to me as if you need to remove the offset from the original socket entirely so it cannot shift away from the bone at all, and then just offset the meshes/skeletons/attached items differently based on the gripping hand.

If you have not moved the socket your self, maybe the socket needs to have z -1 scale applied to it as well?

If all else fails and you need an accurate offset, modify the right hand, add a bone, call it GunBone, re-import the mesh for the skeleton, and attach the socket to that new bone without any rotations or offsets applied. it should just work if you z-1 after that.

**MostHost LA **Thank you !

I just did X - 180, Z - 180 and it works.

But I didn’t think about objects which the pivot is not in the center, they end up with an offset location as well. I don’t know if it can be fixed similarly, I’ll do some tests.

Thx again

As I mentioned, I would modify the base skeleton and just add in a bone for the actual palm rather then shift sockets, if the end goal is to have the item attach in the correct spot on the inverted hand.