No announcement yet.

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

  • Filter
  • Time
  • Show
Clear All
new posts

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


    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.
    Click image for larger version  Name:	20190616-18_03_34Search.png Views:	1 Size:	497.5 KB ID:	1631833
    The skeleton has a socket per object
    Click image for larger version  Name:	20190616-18_04_03Start.png Views:	1 Size:	446.5 KB ID:	1631834
    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.
    Click image for larger version  Name:	20190616-18_04_49Start.png Views:	1 Size:	145.9 KB ID:	1631835
    What would you suggest me to do ?


    Last edited by Bozarre_; 06-16-2019, 12:23 PM. Reason: added tags


    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:
    Click image for larger version

Name:	20190618-23_00_00Start.png
Views:	168
Size:	226.0 KB
ID:	1632764In the Physics Asset the collisions looks alright
    Click image for larger version

Name:	20190618-22_59_35Start.png
Views:	157
Size:	304.2 KB
ID:	1632765 But in the Scene, with the collision debug, it's all messed up
    And it's the same with the sockets
    Click image for larger version

Name:	20190618-23_02_21Start.png
Views:	158
Size:	76.3 KB
ID:	1632766 In the Skeleton editor
    Click image for larger version

Name:	20190618-23_03_11Start.png
Views:	161
Size:	389.3 KB
ID:	1632767 In the scene

    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
        Last edited by Bozarre_; 06-20-2019, 05:22 PM.


          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.