RetroSpecter

Are spine animations compatible with Unity's Cycle offset parameter within the animation clip? And if not, is there a good workaround?
RetroSpecter
  • Messaggi: 4

Harald

Are you using the SkeletonMecanim component? If you are using SkeletonAnimation, then you can configure the start time and looping behaviour via the
TrackEntry returned from SetAnimation or AddAnimation calls.

For SkeletonMecanim I'm afraid we are limited to what the Unity Mecanim API provdes us with. Unfortuantely it seems that AnimatorStateInfo.normalizedTime does incorrectly not account for the cycle offset, it seems to always start from 0.0. Unfortunately there is also no other property available at the AnimatorStateInfo, so I'm afraid to say that we can't support it with the current behaviour.

Regarding workarounds, nothing that can be tweaked at runtime via code comes to my mind. At edit time you could select the Mecanim Transition in the Animator window and move the second track to the left, effectively setting the Transition Offset parameter of the Transition to the desired cycle offset. Or obviously modify the animation in the Spine Editor (cycle the keys around) to effectively start at a different time.
Avatar utente
Harald

Harri
  • Messaggi: 4208


Torna a Unity