Seeking with AnimComponent

Hi,

I have followed this tutorial (Animation without State Graph | Learn PlayCanvas) to build an interactive learning experience about skateboarding : https://www.3dskatetricks.com

For one trick, i have an animation loaded with code, and a json file with stop points. All the animations are 200 frames long, played at 30 fps.
The stop points are added with AnimEvents.

So for the current workflow, playing the animation, everything is working fine, i could listen to AnimEvents and do what i want in the UI.

But in the UI i have two buttons, Next and Previous, which can help seeking to the next stop point without playing the animation between them.

For that i change the activeStateCurrentTime of the baseLayer of the AnimComponent.

this.entity.anim.baseLayer.activeStateCurrentTime = seekTime;
this.entity.anim.speed = 0;

If i do that, after when i resume the animation, the AnimEvents stop working.

this.entity.anim.speed = 1;

Any ideas ?

Looks like there is an issue in general with anim events and adding animations without a state graph where I couldn’t even get the events firing in the first place.

In the ticket above, I’ve made a project that has a workaround of the issue that I found that could be useful to you in your project while we investigate the issue.

Cool

I will make a public simple project asap with my setup to isolate the problem without all my project codebase.

Public project available here : PlayCanvas 3D HTML5 Game Engine

1 Like

New issue in engine repo : https://github.com/playcanvas/engine/issues/4546

1 Like