You may have noticed a delay, even though we set Exit Time to zero. This is because there is a default blending when transitioning from one state to another. However, this can be set to zero so that the state machine switches instantaneously from one state to the next.
Do the following:
- Select each Transition in the Animator window.
- Expand the Settings properties.
- Set both Transition Duration and Transition Offset to 0:
Figure 6.14 – Setting both Transition Duration and Transition Offset to zero
Now, when you run the scene, the bug should immediately switch left and right as you press the corresponding arrow keys.