Play Mixer Animation At A Specific Time ( Playat() Or Skipto() )
I have a basic mesh animation in a .gltf that I want to play at a specific time in seconds. Here's the loader and mixer setup: GLTFLoader.load( 'myscene.gltf', function ( gltf ) {
Solution 1:
When you call .clipAction()
, you get an object of AnimationAction
type, which you can use to chain commands (as you did in your example above). Instead of chaining, you can store this in a variable, and then use the .time
property of AnimationAction
to tell it where to start.
var mixer = new THREE.AnimationMixer( model );
var action = mixer.clipAction( gltf.animations[ 0 ] );
action.setDuration( 60 )
action.play();
action.time = 5;
You can read more about the .time
property in this page of the docs.
Post a Comment for "Play Mixer Animation At A Specific Time ( Playat() Or Skipto() )"