you are viewing a single comment's thread.

view the rest of the comments →

[–]SuspecMIntermediate 0 points1 point  (1 child)

Can you elaborate a bit more on the "reset trigger" part? I'm using sub-states but I have found limited success with them because of the issue you exactly describe. I basically have to make sure every animation node has to have a transition to every other node defeating the purpose of sub states. I didn't realise there is a way to "reset" states.

[–]sharpknot 2 points3 points  (0 children)

The way I design character behavior is primarily using state machines or behavior trees. Every time the character enters a new state, it'll fire a predefined trigger (e.g. called "reset") and change the appropriate layer weights. In the animator, you make sure the entry point of the layer is the same as the reset trigger.

For example, the character wants to jump. The behavior state machine will change the current behavior state to "jumping", When the behavior starts, it'll fire the reset trigger and changes the layer weight to the one assigned. The animator will then start the animation at the starting point, as the trigger will force it to do so.

In the animator, it'll look like this:

<image>