Conditional Playback

Basic Conditioned Playback of an Animation

This tutorial will create an animation graph, with one state, which will play a specific animation when some signal is given. This tutorial will demonstrate this as one of the basic processes that you can perform with the 'Animation Graph'.

  • Create a view called 'Tutorial0'.

  • Create a state called 'FooAni'.

  • Create a node and name it.

  • Set general properties.

  • Set the parent state to 'Alive'.
  • Select the 'Allow selection', 'Include in game' and 'Can mix' check boxes.
  • Set a template and its properties.

  • A template is an xml file that specifies some essential parameters and exposes some configurable properties.
  • The 'IdleOneShot' is a template for playing an animation when it is in an idle state.
  • To check the details of a template, click *'Show template xml file...'.
  • Here, we specify the 'animation' property to some animation of the character.
  • Set up the input and the selection criteria of the state.
  • Set up the 'Signal' input.

  • Here, we'll use the Signal input.
  • Add 'PlayFooAniOnce' to the 'Key Properties'.
  • Set up the state's selection criteria.

  • You can see that there are already some criteria inherited for the parent state.
  • Now, change the 'Signal' criterion from 'Use Parent State' to 'Specified Value'.
  • As a value, set 'PlayFooAniOnce', which we added earlier.
  • Check it with 'State Query'.

  • Click Compile and load graph.
  • NOTE: You should specify at least the Action, Health, Item, Signal, and Stance criteria for the query to work correctly*.
  • Set the 'Signal' criterion to 'PlayFooAniOnce'.
  • Now click 'Perform search'.
  • Our 'FooAni' state is in the result (the number after ':' signifies the match rank. If there are several matches, one of the higher ranks is preferred).