diff --git a/cocos/animation/animation-state.ts b/cocos/animation/animation-state.ts index 5c1fab951ee..3fb0b204488 100644 --- a/cocos/animation/animation-state.ts +++ b/cocos/animation/animation-state.ts @@ -652,6 +652,7 @@ export class AnimationState extends Playable { } private _sampleEvents (wrapInfo: WrappedInfo) { + const length = this._clip.eventGroups.length; let direction = wrapInfo.direction; let eventIndex = this._clip.getEventGroupIndexAtRatio(wrapInfo.ratio); if (eventIndex < 0) {