Jump to content

Animation state machine exit and node entry parameter setting


photo

Recommended Posts

Posted

It seems that it is currently not possible to exit from the state machine. For example, I want to exit from the A state machine and transition to the logical node in the main diagram, similar to the state machine in Unity. Another issue is that I want to set certain parameters after entering a node, such as: when entering the AttackState, set Bool AttackIng = true, and when exiting the AttackState, set Bool AttackIng = false.😁CVW0G)T(SHFIVS62.png.a57653787abe00124fce8392ad416d68.png

Posted

Hello.

In our animation graph, transitions between states are managed at the parent state machine level rather than through a dedicated Exit node. An Exit node implies that a nested state machine is a "black box" that signals its own completion. From the outside, only an arrow between blocks is visible, and inside only Entry and Exit. As a result, it is impossible to trace the full transition path without diving into each nesting level. We aim to maintain maximum transparency of transitions. Transition conditions can use context expressions - Animation Ended, State Time, Anim Time Remaining, etc. - which automatically read the animation state from the currently active state, including nested state machines. If an animation inside a nested state machine has finished playing, the parent Condition will detect this through Animation Ended. The set of context expressions will be expanded over time.

Parameters inside the graph are read-only - this is a deliberate decision to preserve a single source of truth. Parameter values are set from game logic, so it is always clear where and by whom a parameter was changed, which greatly simplifies debugging.

Posted

Here is a small example in which transitions are built based on a trigger variable, Animation Ended, and Anim Time Remaining.

 

 

Posted

OK,Thank you for your response. I noticed that one of the future animation updates includes animation events. Will there be more API for adding animation code? The most important one is the animation end callback function, such as Animation.play("Attack").OnComplete(); similar to this method, and Animation.play("Attack").OnNormalTime(0.8F).=>, which is an event that triggers at a certain moment. All of these are registered and executed at the code level.😁

×
×
  • Create New...