Change a variable when a particular animation state is entered.

Is it possible to set a variable when a particular animation state is entered?

When a particular condition for my animation state machine is met and the state changes from one animation state to another, it is possible to change the value of certain variable when the state change occurs?