I have a script which calls the animation controller .play function when receiving events.
I’m able to call the .play function fine but when I loop through .assets array to get animation names they are undefined. The assets array only has asset ids, everything else is undefined. How do I get the names of the animations?
//get the animation controller
for(i=0;i<this.entity.children.length;i++){
if(this.entity.children[i].tags.has("anim")){
animController = this.entity.children[i].animation;
}
}
//try to get the animation names but they are undefined
for (var anim of animController.assets){
console.log("name is ",anim.name);
}
I’m sure I’m missing something here. Thanks for any help.