Mesh transforms when attached to bone

Hello :slight_smile:

If you have a look at this topic : Walking on Snow I’m attaching some cubes to the foots in order to create the walk on snow behavior :

(Cubes visible)
snow2
(Cubes invisible)
snow3


I had to deal with placing the cubes at the right place regarding the foots.
It’s basically a matter of transform :

box.position = new BABYLON.Vector3(4.5,3.5,-0.5+index);
box.attachToBone(skeletons[0].bones[id], dude);

:arrow_right: Playground


If you go box.position = new BABYLON.Vector3(0,0,0); the box center will match the exact position of the bone. So it means box.position becomes a relative position regarding the bone, after box.attachToBone. You can have a look at the freezed version for better understanding

Hope it will help :slight_smile:

++
Tricotou

1 Like