How to control the posture of the GLTF character?

I am new to babylon.js.

I’m thinking of controlling the posture of a GLTF character programmatically.
I am modifying and testing the tutorial.
https://playground.babylonjs.com/#Z6SWJU#5

I would like to change the posture interactively using a GUI such as a slider, but for some reason the posture returns to its original state. It seems that the posture is reflected when the posture control is executed in scene.registerBeforeRender. What’s wrong with this?

The playground tested is as follows.

https://playground.babylonjs.com/#BURA8L#25

Thank you.

I fixed it here : https://playground.babylonjs.com/#BURA8L#26

So basically, the bones are locked because they are not moving the mesh. There are linked to transformNodes, which are in turn parenting your meshes. This is just the way Babylon handles bones and armatures.
This problem has been encountered by many people in the past and there is since an easy method Bone.getTransformNode() that returns the object that can actually be rotated, scaled, etc.
Then you can just give it the rotation property you like, just like on a Mesh, because TransformNode don’t have a setRotation method.

Hope it solves the problem. :slight_smile:

3 Likes

Dear Faber,

Thanks a lot!
It works well!

Thanks again.

No problem !
I realized I totally forgot the obvious : welcome to the babylon.js. :smiley: And welcome to the forum !
Feel free to ask anything you need, there will always be someone to help.
If you issue is fixed, please mark the question as solved to help the next users looking for answers ! If you have more problem, don’t hesitate to open a new topic.

Welcome again :heart:

2 Likes