There have been many questions about parenting an Object to a bone, however all of them have an issue:
The Object only moves with the bone when the bone is updated as part of an animation, when the Character moves, the Object stays behind.
Furthermore, if the animation does not move the bone on every frame, the attached mesh lags behind.
Take a look here:
https://playground.babylonjs.com/#N4T4AJ#4 (Change line 60 to try workarounds below)
I found a few workarounds but they don’t seem to be optimal:
a) Mark bone as dirty on every step of the character
b) Move character with skeleton
- What is the recommended approach to attach mesh to a bone without animation?
- When I want to move a character, should I move its mesh or skeleton? The popular lib I use, CharacterController moves it by character, I would have to rewrite it to move its skeleton.
- I think I am misunderstanding the parent relationship here, when I move the character, shouldn’t the skeleton move, then the bone, then the attached object?
Similar topic WITH animation:
This one breaks down as soon as you comment out the animation out on line 48, see it here:
(new users can’t post more than two links)
Thanks a lot for any help in advance!