playMaker

Author Topic: Managing an animation clip's speed through Playmaker & Mecanim  (Read 2795 times)

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Managing an animation clip's speed through Playmaker & Mecanim
« on: December 04, 2015, 10:16:19 AM »
Hi,

I cannot find an action that specifically allows me to manipulate the speed of an animation clip.
There's one under /Animation, called "Set Animation Speed" (quite straight forward isn't?) but it requires an animation component on the object that uses the clip, or at least on its parent, and that's a legacy thing.
But I use Mecanim. I'd prefer to avoid any odd combination, confusion and lack of compatibility.
Or maybe it still does work... at least a confirmation from Hutong Games that this is the way to go would do.
Perhaps the closest thing I could use is something that allows me to modify the speed of a state within the Animator tree.

Can somebody help me sort this out please?

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Managing an animation clip's speed through Playmaker & Mecanim
« Reply #1 on: December 04, 2015, 10:22:53 AM »
I must add that I'd rather avoid having to use the cumbersome blendtree system for something so simple, especially since you cannot set a speed lower than 0.01 in the motions specified in the state's blendtree.

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Managing an animation clip's speed through Playmaker & Mecanim
« Reply #2 on: December 04, 2015, 10:59:03 AM »
Okay, I'm autoreplying to... myself. Nevermind.

Until some kind of clean solution appears, it turns out that the only way to reach my goal (amongst other things, properly pause an animation clip) is to use a ... blendtree.   :'(

One blendtree, two motions. First has a speed of 1, the basic by default value.
The other has a speed of -1.
Then in the blend value of the blendtree, you put 0.5.
It shows as a float (which you can rename) in the Animator's Parameters' tab.
And Set Animator Float is the action that will let you change it.

No comment.   :-X
« Last Edit: December 04, 2015, 11:04:16 AM by Broken Stylus »

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Managing an animation clip's speed through Playmaker & Mecanim
« Reply #3 on: December 04, 2015, 11:09:48 AM »
Or use a substate machine, and branch out to two states playing the same animation, but with different speeds (adjusted in the Inspector).
The path taken is influenced by parameters, used as conditions.
You still need a debut state in the substate though. It is from this internal state in the substate that the two identical states that play the animation at different speeds will branch from.
I figure the initial state within a state needs none as an animation, or an animation clip with nothing in it?
« Last Edit: December 04, 2015, 11:14:30 AM by Broken Stylus »

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Managing an animation clip's speed through Playmaker & Mecanim
« Reply #4 on: December 04, 2015, 11:19:41 AM »
Ah, a lil' update to Unity 5.2 and we have the possibility to turn a state's options (for a lack of better term) such as speed into parameters which can be accessed.
Okay.
/thread