After trying out SkeletonMecanim earlier today ( SkeletonMecanim: unintended behavior? ), I discovered a feature that seems missing from it and that we really need for our game project.

In Mecanim, the current time in a specific animation state can be controlled by a parameter using this setup:

1. Add a float parameter
2. Go into the animation state
3. Next to "Normalized Time", select "Parameter" and select the parameter

As in my previous thread, I created a test project (using Unity 2019.1.0f2, Spine 3.7.94 and the latest runtime). There are two moving boxes, one animated in Unity and one in Spine. The setup in the animation controller is exactly the same. The normalized time parameter for both boxes is controlled via a slider, with exactly the same code.

I also made a little video to show it in action:

As you can see, this works perfectly with animations created within Unity, but SkeletonMecanim does not seem to support this. Please consider supporting this in the future, it would be very useful for our project. :)




I tested and looked around a bit more, and this seems to be a Unity problem.

AnimatorStateInfo.normalizedTime, which spine-unity uses, returns the total play time of the animation, rather than the time when the animation is evaluated. Unless you use the editor parameters ( and serialize them separately, which would be a really bad workaround, there does not seem to be any way to get the "evaluation time" from the animator state, making this thing impossible to support. :(
Bạn không được cấp phép để xem tập tin đính kèm trong bài viết này.
  • Bài viết: 2


Thanks for the input, this seems indeed quite reasonable.

I have added an issue ticket here:

Just noticed that you have posted again - I will check if this feature is feasible, otherwise we will have to live without it. Unfortunately, the exposed Mecanim API is not too extensive, so we'll see what we can get.


After a long time and Unity 2020 still not exposing the Motion Time parameter at runtime [1] via its Mecanim API, we had to close the issue ticket, sorry!

We are happy to re-open it as soon as there is a way to access the field at runtime.

[1] Only providing it for editor scripting in UnityEditor classes here.
Hình đại diện của thành viên

  • Bài viết: 1932

Quay về Unity