Skip to content

Commit

Permalink
animation mixer early declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-buist authored Aug 9, 2024
1 parent d5c0456 commit 7f68838
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import { DRACOLoader } from './scripts/three/examples/jsm/loaders/DRACOLoader.js
var active_scene = new THREE.Scene();
var scene1 = new THREE.Scene();

//Animation Mixer
let mixer;

//Canvas
var myCanvas = document.getElementById('myCanvas');

Expand Down Expand Up @@ -156,7 +159,7 @@ function init() {
gltf.scene.rotation.set(0, Math.PI, 0)
gltf.castShadow = true;

var mixer = new THREE.AnimationMixer(gltf.scene);
mixer = new THREE.AnimationMixer(gltf.scene);
gltf.animations.forEach((clip) => {

mixer.clipAction(clip).play();
Expand Down

0 comments on commit 7f68838

Please sign in to comment.