Anim State Graph Closed Beta - Feedback here!

@redka @dinof @Fus_ion A fix has been released to production which should address the issues/crashes you were experiencing when editing state attributes in the graph editor.

4 Likes

Hello,

As I understood from “Tutorial Anim Blending” its impossible to prepare movements of entities through “Anim State Graph”, am I right?

What do you mean by ‘movements of entities’?

For example I want to prepare simple sliding door system which should be controled by a 2d button, so I need to prepare conditions of how sliding doors should open: speed of opening, length of movement of each door etc., so all this things I need to write in JS code which will be added to an entity in main editor of playcanvas, did I understand correctly?

It sounds like you were thinking this would be an animation timeline? The state graph is more of a logic state machine that’s gated by parameters. It doesn’t actually do the animation.

You can attach animation to each state which plays when the graph enters that state.

Is it possible to find some similar samples with doors here?

Code would generally be the simplest way to approach this as it’s a simple linear movement. Please start a new thread if you need further help on this.

I just had a quick look at the anim state graph, it looks to have all the functionality required to transition between animations.

I was going to look into it as a way to handle UI transitions, but of course there is no way currently to create animations for UI ( or other ) elements, they need to be imported from an external package ( which isn’t possible for the built-in components ).

Are you planning a way to create animations within PlayCanvas ( a keyframing tool )?

Unfortunately, not on the short term roadmap. I think the next major bit of Editor work with be to standardise the Editor API so that plugins and extensions can be made.

That said, we did have some brief discussions about the state editor being able to do more than drive GLB animations but again, not in the short term. Would be great to have it be able to call tweens for example.

1 Like

If I create an enitiy with the new anim component and I add a child entity as the root bone, the root bone is missing when I copy the entity or create a template of it. I assume the root bone has to be my model?

image

For some reason, the animation will also not start if the root bone is a child entity. If the root bone is the entity with the anim component on it, the animation will start correctly.

An error on the bottom and an error in the console:

I now get stuck with this error:

This error arises when I add a new (third) state:

When I attach another animation to this state the error stays.
If I remove the animation (so only an emtpy state) the error is gone.

Also when I add an empty state without any transition the animation stops working.

Hmm… It might be because you are using JSON for animation. @Elliott can we use JSON with the state graph or just GLBs?

nope, only glb animations are supported.

1 Like

Yes, that was the problem indeed. I re-imported all animations as gbl and that fixes the last reported error. Thanks!

In the example below I want to set the animation back to state Base if one of the two conditions is not matching the requirments. I have the feeling this is not possible right now. If that’s true is there a work around for this?

Also I like to know what the state Any means, because I can’t make a transition to this state, only from this state.

I already figured out that I can do this by creating an extra transition and separating the conditions.

I still want to create a ‘Base’ state without animation. I thought to use the ‘Any’ state for this, but that doesn’t seem to be possible. Right now my ‘Base’ state needs an animation to work, but I think this is going to glitch as it goes from animation to animation to animation.

The Any State represents any of the states.

Let’s say you have States A, B, C. You then make a transition from ‘Any State’ to State D

This means that any of the states (A, B, C) can transition to State D.

Can you give your use case please? From the graph, it looks like you could be using the Any State instead?

Yes, that’s exactly what I was looking for, thank you! I was under the assumption that a way back to Any State was needed, but that is not the case. With this setup it would be nice if I could remove the Initial State and Default Transition.

1 Like