Trigger Animation Instantly?

Hey!

I’m trying to trigger an animation on a button press, unfortunately it doesn’t seem to respond within a decent amount of time - let alone the near instantaneous behavior I’m looking for. Basically player presses a button and I expect him to change from one animation state to the other. However it takes way too long (haven’t actually timed it) for it to happen.

Here’s the code (called from a method that is called in the Update() loop)

if (_nextGem != null && Input.GetKeyDown(_laneButtons[NOTE_LANE.Bottom])) {
    _gemSmashers[(int)NOTE_LANE.Bottom].GetChild(0).GetComponent<GemSmasher>().onSmash();
            checkHit(NOTE_LANE.Bottom, (Time.time * 1000.0) - _start);
} 

.
.
.

private void checkHit(NOTE_LANE lane, double time) {

    _characterAvatar.SetTrigger("RideToOlly");

.
.
.

That’s the only code that deals with animation currently.

Attached are some pictures of the animation controller.


39148-animation_issue_three.png

I’m not sure if this is an issue with my code, or with how I’ve handled the transition in the controller. I’ve tried adjusting the exit time in the transition, I’ve tried the different update modes, etc. Nothing seems to be having an effect. =S

Help would be appreciated!

Alright, answering my own question is probably poor form BUT, I managed to figured it out. I removed the exitTime condition from the transition and VIOLA it works!

You need to make the transition time smaller. You see that blue outline in the inspector which shows the transition from Riding to Olly? That signifies the length of the blending between the two animations. If that’s shorter, you’ll get the change in animation much more quickly - though if it’s too short, things might look bad as your model “snaps” to the new state

Just grab the arrows on it to make it narrower. If you need to sometimes jump to the animation, and sometimes let it blend naturally, set up two different transitions and give them different setups.