How it works...

State transitions define how we can travel through the graph of animations. They are combined with transition conditions based on Animator Controller parameters; we will discuss the parameters in detail in the next recipe: Using parameters to control the animation flow. Each transition has a set of properties we can adjust. Click on the transition (white arrow) to select it. You can find the transition properties in the Inspector tab (make sure to unfold the Settings foldout):

  • Has Exit Time: If set to true, this enables the transition only after a given percentage of the animation has been already played. If disabled, the transition will take place instantly after its conditions are met. If you want to create a sequence of animations, set it to true.
  • Exit Time: This is the percentage (0-1 range) of the animation length after which the Has Exit Time condition is met. If you set it to 0.5, for instance, the state will transition after 50 percent of the animation was played.
  • Fixed Duration: This property is combined with the next one, Transition Duration (s). If it's on, the Transition Duration (s) is in seconds, and if it's off, the Transition Duration (s) is in percentage of the animation time.
  • Transition Duration (s): the time of the state transition. This is how long the animations will transition one into another. Animations are being blended together during the transition. Longer transitions are smoother, shorter, are more sharp. A good default value is around 0.25.
  • Transition Offset: This offsets the target animation in time. The value is in percentage of the animation. Setting it to 0.3 means that the target animation will start from 30 percent of its length instead of the beginning.
  • Interruption Source: This setting tells Unity whether the transition can be interrupted by other transitions. You can set it to:
    • None: the transition cannot be interrupted by any other transition.
    • Current State: The transition can be interrupted by transitions from the state we are trying to transition from.
    • Next State: The transition can be interrupted by transition from the state we are trying to transition to.
    • Current State then Next State: The transition can be interrupted by the transitions of the state we are trying to transition from or by the transitions of the state we are trying to transition to. The transitions from the state we are trying to transition from take the priority.
    • Next State then Current State: The transition can be interrupted by the transitions of the state we are trying to transition from or by the transitions of the state we are trying to transition to. The transitions from the state we are trying to transition to take the priority.
    • Ordered Interruption: If set to false, this lets the transition be interrupted by other transitions independently of their order. If set to true,the order of the transitions matters.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.139.172