Plays an animation by index or name. Sets duration of animation, if it equals zero, then the entire animation is played