I want to start second animation after end first animation without stopping first animation. how can i do that. Here is my code
When i do uncomment of commented code animationActions[1] starts when animationsActions[3] doesn’t ended
const setAction = (toAction: THREE.AnimationAction, setIfSame: boolean = false) => {
if(toAction != activeAction || setIfSame) {
lastAction = activeAction
activeAction = toAction
lastAction.fadeOut(0.2)
activeAction.reset()
activeAction.fadeIn(0.2)
activeAction.play()
}
}
const onSpaceDown = (event: KeyboardEvent) => {
const {code} = event
if (code === 'Space') {
TWEEN.removeAll()
setAction(animationActions[3], true)
activeAction.clampWhenFinished = true
activeAction.loop = THREE.LoopOnce
// setAction(animationActions[1])
}
}
window.addEventListener('keydown', onSpaceDown, false)