Hi guys,
I'm trying to wrap my head around Track Entry and can't get it to work consistently. I want the game object to deactivate after completing it's animation. 50% of the time it works the other times the object instantly deactivates BEFORE playing it's animation.
http://esotericsoftware.com/spine-unity-events#AnimationState-vs-TrackEntry-events
using Spine;
using Spine.Unity;
void Update()
{
_skeletonAnimation.AnimationState.Event += HandleEvent; //Its a RED error in VS
_skeletonAnimation.AnimationState.Complete += delegate (TrackEntry trackEntry)
{
gameObject.SetActive(false); //Game Object instantly gets deactivated before the animation can complete
};
}
I tried an event instead, but SkeletonAnimation game objects don't recognize animator controllers. Any help is appreciated.