Hi.
I am working in the editor and have an animated model. Means it has the animation component and 2 assigned animation clips (new glb system).
in code I want to switch some animations, but not by name. In this case I would prefer to play animations by array ID, where the array consists of the assigned anims in the editor.
However …animation.play(“wantsToHaveAnAnimationclipName”)
I read some forum topics but nothing works. I get asset ids but no names:
console.dir(this.characterAnimEntity.animation.assets);
var idleAnim = this.characterAnimEntity.animation.assets[1];
console.log(idleAnim); // returns asset id
console.log(idleAnim.name); // returns undefined
//this.characterAnimEntity.animation.play(idleAnim, 1 ); // error
how do I get the name?