Hey guys,
sometimes my spine events won't trigger for none of my animations.
After about 10 minutes of gameplay, without a clear reason or error,
my HandleEvents functions won't be called anymore.
Normaly it triggers as it should but sometimes it's like the event listener is gone.
My code looks like this:
void Start()
{
state.Event += HandleEvents;
}
void HandleEvents(Spine.TrackEntry entry, Spine.Event e)
{
if (e.Data.Name == eventA)
{
//Do some A stuff
}
if (e.Data.Name == eventB)
{
//Do some B stuff
}
}
I tried to debug the AnimationState Script with Visual Studio. But I'm not sure what the error is.

The picture is from debugging, while a animation is running which don't trigger.
I'm not sure if the event count is supposed to be at 0 nor if there should be a null event in there.
Does anyone know at which line in AnimationState the events should trigger so I can look after it myself?
I thought the trigger happens in the Drain() function (Line 999) and I saw that drainDisabled is true.
But I'm not sure if this is related to the problem.
Has anyone a clue what could cause this problem?
It's pretty annoying and destroys the whole game, since the character is stuck every few minutes until I restart the game.
Thank you very much 🙂
Okay I think I figured it out.
Another rare error in an event breaks the callstack so drainDisabled will never be false again.
Maybe try catch block or something similar around OnEvent would be great 🙂