[SOLVED] Anim currentTime and Duration

Hey everyone!

I have a question about anim component and state graph. A few years ago, when we used to use animation component, not anim, there were properties such as currentTime and duration, so we could start our animation not from the begining, but from some specific time. Is there something in anim component like currentTime property? Or in other words is there any way I can stop my animation in some point and start other animation not from the begining?

Thank you in advance!

Similar properties are available on the animation layer: https://developer.playcanvas.com/en/api/pc.AnimComponentLayer.html

If you are only using one layer in the Anim State Graph, you can get to via the Anim Component this.entity.anim.baseLayer (https://developer.playcanvas.com/en/api/pc.AnimComponent.html#baseLayer)

Thank you! I found them :slight_smile: But it seems, I can only read them. Could you help mewith example, how can I start other animation not from the beginning ?

e.g. I changed the parameter, so I’ll have other animation state: characterEntity.anim.setInteger('status', 0)
But what sholud I write next, so it will start for example not from 0 point, but from the 1 sec moment in the anim track?

Thank you!

Oh, I got it. It works if i change anim.baseLayer.activeStateCurrentTime
My animation just was to fast, and I thought it starts from the beginning, because I didn’t see any difference

1 Like