Current frame in an animation

Current frame in an animation
0.0 0

#1

I am working on a project with Cocos Creator that require me to sync several animations together.

Is it possible to go to a specific frame in an animation and play from that?
Know which frame is playing in an animation?


#2

Hi! Here’s a piece of code I use to reverse an animation mid-air, hope it’ll point you in the right direction, check out cc.AnimationState stuff

		var anim = this.animation || this.node.getComponent(cc.Animation);
		var clip = this.clip && this.clip.name || anim.defaultClip.name;
        var state = anim.getAnimationState(clip);
		var stateTime = state.duration - state.time;
		state.wrapMode = cc.WrapMode.Reverse;
		state.time = stateTime;
		anim.playAdditive(clip);

#3

@persy this is a great way to find out current position of the animation

Is there a way to go to a specific frame in another animation and display that with out playing it .

What i need to do is sync 2 animations …


#4

try something like this:

var state = anim.getAnimationState(clip);
state.time = desiredFrameTime;
state.sample()