Mecanim - Change animation speed of specific animation or layers

Bump. We have had a lot of trouble justifying using Mecanim because it’s vital we can set the speed a state is executing in. Failing this it would be nice to be able to set a motion’s speed to 0 at the end of a blend tree as a hacky workaround. Currently this has to he 0.01 which is daft.

This means we can’t pause on a ladder at a specific frame depending on speed. Or slow down crawling to a stop. There’s a lot of issues here, and it’s a woefully incomplete implementation without being able to set the speed of an individual state.

1 Like

We are speaking into Deaf Mecanim Ears. It’s already been 2 years. Unity just doesn’t care enough about making Mecanim feature complete. It’s more about selling the idea of a great animation system and then leaving it half baked. How many more years do we have to wait and how much more money to spend to upgrade in order to get what was promised 2 years ago? Common, it’s about time that Mecanim at least match the old animation system.

1 Like

I’d need this feature as well…

It’d be nice if a Unity Dev could tell us if they are planning to implement it (or at least considering to implement it).

I’d like to add myself to the long list of people who need this. I’ve started changing everything to using Mecanim, and now I’ve run into needing to control speeds of individual animations as well. It’s weird that this never was added. Will it come to Unity 5, at least?

Bump. What’s the point of even using mechanim right now. I’ve spent the last few days getting everything set up to start using mechanim just to realize I can’t even control animation state speed! I mean seriously why is this even still an issue at this point.

Bump. We need a fix/solution for this problem.
I can change the animator.SetSpeed for some pre-defined states that require a different speed and swap the value when transitions occurs but it’s an ugly and glitchy workaround… and will not work if we have layers.

Bump. Any news for a fix or when it will be solved by UT?

your method works well.

You can do something like this:

//get the current state
var stateInfo = animator.GetCurrentAnimatorStateInfo(0);

if (stateInfo.nameHash == Animator.StringToHash(“Base Layer.Idle”))
{
animator.speed = 1;
}
if (stateInfo.nameHash == Animator.StringToHash(“Base Layer.Walk”))
{
animator.speed = Math.Max(1, speed + 1);
}
else if (stateInfo.nameHash == Animator.StringToHash(“Base Layer.Run”))
{
animator.speed = Math.Max(1,(speed - 2)/3 + 1);
}
else
{
animator.speed = 1;
}

Its not perfect but it works

+1 We really really need this!

My god… I just started with Mecanim and this is my welcome news… no way to control a clip speed… what a joke…

2 Likes

I can’t believe there’s no way to change individual state speed. I hope this is fixed to new unity 5. Mecanim is out since Unity 4, how can such an essential feature is not even in the road map.

Just wanted to bump this up as well… I’m at the state of my development where I definitely need this feature. I know it probably won’t come in time for implementation in my current project but it would definitely be nice for a future project to be able to set the animation speeds for layered animation.

It looks like it may come in 5.1 (so in a long long time :stuck_out_tongue: ) : Please vote on this bug in the issue tracker (Mecanim problem) - Industries - News & General Discussion - Unity Discussions

Bump. I need this too. If you want this feature. Vote it up in the feedback form:

http://feedback.unity3d.com/suggestions/allow-scripting-of-playback-speed-for-individual-states-in-mecanim

A unity developer got back to me after i’ve forwarded this thread and said that they know about it and is indeed ready, should be deployed with 5.1.

Btw @Phong , really like that fast shadows of yours.

If it is ready why wait till 5.1? What about a hotfix? At least adding it to 4.6. That is a “feature” (that isn’t really a feature… I thought it was common sense) which belongs to Unity 4.x.

Dunno. I’m just saying what i’ve been told. Most probably there are background changes that need to be made first in the rest of the system for it to work and can’t allocate people atm to work for that cycle. Dunno. Perhaps it will be updated in the 4.6 as well down the line.

workaround script I came up with for dealing with time-scaling using blend trees

+1 I was shocked to find this thread and realize that what seems like a basic behavior is not supported in Mechanim.