Animation Switching
Switch between animations with blending:
// Later, switch animations with blending
document.getElementById("walk").addEventListener("click", () => {
idleAnim.stop();
walkAnim.play(true);
walkAnim.speedRatio = 1.0;
});
document.getElementById("run").addEventListener("click", () => {
walkAnim.stop();
runAnim.play(true);
runAnim.speedRatio = 1.5;
});