Mecanim not transitioning

I have a walking state (named “WalkForwardBlend”) that is entered when “Speed” is greater than 0.1. This state consists of a blend tree. (all set up like the Mecanim tutorial). However, now I want to add a new state from the walking state for Running (I don’t want to setup multiple blend trees, because the animations don’t match for running/walking).

So I created a Running state (named “tr_mo_mektoub_selle_course”, after the animation), and created a transition for “Speed > 0.51” to it from the “Walking” state (and created the appropriate transitions back for when you slow down):

Idle -->(speed > 0.1)–> Walking → (Speed > 0.51) → Running
Running -->(Speed < 0.51) → Walking → (Speed < 0.1)–> Idle

The walking state is entered, but even when Speed goes to 1.0, it never gets to the running state. It just stays looping in “Walking”.

Is there some problem with this setup? Why will Mecanim not go to the new “Running” state?

Since a picture is worth a thousand words - “Speed” is 1.0, the transition is “Speed” “Greater” “0.51”:

Well as you said this looks wrong. I have done this myself on many occasions so now comes all the follow up questions, like versions and blah blah blah. Which leads to the next sentense:

A repro project is worth a thousand pictures. :slight_smile:

Submit a bug with the repro project. You can launch the bug reporter from inside Unity menus Help|Report a bug. And it has the option to zip the project into the bug report quite automatically. That will tell us version, hardware, and all the other boring stuff that might be important.

Post the bug report number here and I’ll take a look. :slight_smile:

the problem is because the state for walking is still true. if the condition was if speed >0.1 speed < 0.5 it would probably transition to the next one. but i have a feeling it would just go back to idle because the condition would end up false for a small time between 0.5 and 0.51.

if your animations dont match for walkring/running its not going to work this way either. im pretty sure what you want to do is exactly what blend trees are for. you can also adjust the start and finish of the animation in the inspector tab, so that like they both start and finish with the left foot down. that way the animations should sync up.

@Proportion1: Only the transitions leading away from the current state is evaluated. So the fact that a transition to the state is still valid does not change the ability to leave it.

The other stuff about synchronizing the loops is about making stuff look good. Mecanim will play any animation you ask it to, regardless of insane that may end up looking. The reason is simple, sometimes a crazy animation is what you need, I’m thinking specifically on the Apparition effect in the Harry potter movie, seen from an animation perspective that is utter madness, but if anyone want to try something similar Mecanim wont try to stop them.

Well, this is strange, but I exported everything to a second project in order to create a bug report, and it works in the second project (the main project is 32GB in size). After saving/exiting unity/reloading the original project also works.

Earlier, I had created a transition from “Any state” to walking. But this was problematic, so I deleted all “any state” transitions. My guess is that there was something hanging around that didn’t get cleaned up internally when these “any state” transitions were deleted.

Thank you for the suggestions, but unfortunately a blend tree will not work in this instance because the creature has four legs and walks/runs like a dog. That is, walking is normal, but running is more of bounding - so the animations are completely different kinds of movement and won’t blend.

ah ok. all i have used with mecanim is humanoids. i did make a cool game with IK’s but heh.

I have duplicated the problem - When you select a transition in the animator flowchart view, and hit the delete button, it warns you it’s permanent, and deletes it from the display. However, i__t still processes that transition until you exit and reload your project__.