On my project I attach an object to a bone of my character (GLTF). Like this :
const boneIndex = this.actorSkeletons.getBoneIndexByName("L_Hand"); mesh.attachToBone(this.actorSkeletons.bones[boneIndex], this.actor);
But when I do, the object disappears. It exists on the scene but in an unknown space.
So I looked with the DebugLayer, and it found that in the list of parenthoods, the character’s bones are duplicated. One or it is ok and the other the second which is unknown.
It turns out that when I attach the object to a bone, it’s on the second L_Hand that the object attaches, but that doesn’t represent anything.
I have only one character and only one skeleton to the character. There is no reason for the bones to be duplicates.
And that seems to happen only on the character. The other objects do not have their name to duplicate.
So I tried to reproduce this in a PG, but found that in the PG all the parents were marked ‘No Name’. So I can not reproduce, but it seems that there is a problem with the names of the parents either duplicated or undefined/no name.
In the PLayground :