Hi my fellow game devs,
i have a problem with my animations. they seem to work in code (alteast animation.currentTime is correctly updated) but my model stays in T-Pose.
var GoalKeeperAnimationController = pc.createScript('goalKeeperAnimationController');
// initialize code called once per entity
GoalKeeperAnimationController.prototype.initialize = function() {
this.model = this.entity.findByName("Model").model;
this.setState("keep");
};
// update code called every frame
GoalKeeperAnimationController.prototype.update = function(dt) {
if(this.model.entity.animation.currentTime >= this.model.entity.animation.duration){
this.model.entity.animation.currentTime = 0;
this.setState("keep");
}
};
GoalKeeperAnimationController.prototype.setState = function(state){
this.state = animationStates[state];
this.model.entity.animation.play(this.state.animation, 0.2);
};
animationStates = {
keep:{
animation: "WGkeepBall.json"
},
catch1:{
animation: "WGsaveBall01.json"
},
catch2:{
animation: "WGsaveBall02.json"
}
};
did i miss something or are there any engine settings that prevent animations from playing ?
thx, for reading this