Jump to content

Rotation after mount mesh to bone


Recommended Posts

Hi, after finish inventory GUI in my game - babylon.furcatomasz.pl I have small problem with mesh rotation after mount item to bone. 

For reproduce problem open my game, open inventory and click to any sword to change, then mounted item has wrong rotation.

its my code to mount item:

mesh.attachToBone(bone, meshCharacter);
mesh.position = new BABYLON.Vector3(0, 0, 0);

bone.getRotationToRef(BABYLON.Space.WORLD, meshCharacter, mesh.rotation);
mesh.rotation = mesh.rotation.negate();
mesh.rotation.z = -mesh.rotation.z;

Variable mesh is item to equip.

Thanks for help, Tom.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...