fuglesang

Hi!

I'm having trouble figuring out a way to set up a blend tree with the Spine Unity runtime without using Mecanim.

What I want to do is this: with 3 animations (idle, walk, run) I want to setup the animation so I can smoothly go from idle towards walk then further to run using a weight value (0-1).

If you picture the input from a controller stick that is 0 in the center and 1 when moved to the edge. When the stick is not moved the animation should be 100% idle. When moved half way the animation should be 100% walk. When moved all the way to the edge the animation should be 100% run.
Value Mix
0.00 100% idle
0.25 50% idle 50% walk
0.50 100% walk
0.75 50% walk 50% run
1.00 100% run
Mecanim has this functionality (http://docs.unity3d.com/Manual/class-BlendTree.html) but due to limitations in Mecanim we want to try using the Spine animation system.

If someone could point me in the right direction it will be much appreciated.
fuglesang
  • Сообщения: 2

Mitch

SkeletonAnimation itself does not support blend trees, however Spine.Animation can be applied and mixed however you like by applying them directly to a skeleton and dealing with the queue/loop stuff on your own.

This was probably the first thing I did when I came to the Spine community - I haven't found a good way to standardize it though because of the nature of trying to blend attachment and other one-frame keys. Best to roll your own to avoid the Mecanim quagmire.
Аватара пользователя
Mitch

Mitch
  • Сообщения: 975

fuglesang

Thanks for the response, Mitch.

I've been looking through the source and documentation for a way to do this and came to the conclusion that using the Spine.Animation seemed to be the way, but all my tests using it didn't really do anything. I'm guessing I'm missing something important.

Could you post some of your code where you do this? Even if it's not generic I need to see a working example that I can then modify.
fuglesang
  • Сообщения: 2

flashframe

Hi!
I've been trying to work out how to do this in Unity today, and would also be grateful for any code snippets or pointers you might have Mitch, if you've got time?
flashframe
  • Сообщения: 20


Вернуться в Unity