[SOLVED] Playing animation just once

Hello guys, i need to know how to play specific animation just once, i know there is a loop tickbox but i have 4 animations on one object which need to be looped and one that i dont want to be in loop and be played just once, any ideas? :slight_smile:

you could update setstate part of the script:


Scriptname.prototype.setState = function (state,loop,blend) {
    var states = Scriptname.states;
    this.state = state;
    this.entity.animation.play(states[state].animation,blend);
    if(loop === undefined){
        this.entity.animation.loop = true;
    }else{
        this.entity.animation.loop = loop;
    }
};
2 Likes

Thanks that worked pretty enough :slight_smile:

1 Like

Are you sure this line is correct?

Edit: Nevermind, I already see what you are doing. :yum:

1 Like