Open warrenchopin opened 1 week ago
Ths is a playground exmaple of Dude from Babylon.js site. How can I set animation? https://playground.babylonjs.com/#92Y727#450
Your scriptloader doesn't seem to be working Anyway I copy/pasted the charactercontroller script into the playground. Here is the basic code https://playground.babylonjs.com/#W48M0E Please see documentation/examples on how to setup the player, its ellipsoid, camera etc. example here https://github.com/ssatguru/BabylonJS-CharacterController-Samples/tree/master/sample-global
For questions on glbs, animationgroups etc goto babylonjs forum
Thanks for your help. i can see aniamtions ('Idle', 'Walk', 'Run', etc.) of the avatar in Inspector window of Playground. I set animation as following.
cc.setIdleAnim("Idle",1,true);
cc.setWalkAnim("Walk",1,true);
cc.setRunAnim("Run",1,true);
Playground: https://playground.babylonjs.com/#W48M0E#2
But it doesn't work. What was wrong?
This character has animation groups not animation range.
You can set the animation range in cosntructor https://github.com/ssatguru/BabylonJS-CharacterController?tab=readme-ov-file#to-instantiate
or pass as parameter https://github.com/ssatguru/BabylonJS-CharacterController?tab=readme-ov-file#to-change-animation-range-name--animation-group-and-their-parameters
also see https://github.com/ssatguru/BabylonJS-CharacterController/blob/master/tst/testAnimationGroup.js#L139
Following is a Playground example to use a new avatar. You can see the source code there. Please help me fix it:
https://playground.babylonjs.com/#AJA5J6#361
The loaded container has three meshes. How to feed to CharacterController()? Do I have to select only one of them or do I have to do parenting? How to set skeleton? Also, how to set animation?
Thanks in advance.