Good day stranger, as the title suggests, I've been wracking my head around trying to figure out why some animations won't play when I set them to play using SetAnimation()
Just a short description of the project I'm working on: Mobile Auto Chess Style drag n drop heroes/characters and they fight automatically.
Basically I have a setup where upon starting the game, the character will enter the initial state with events added on to the Complete event and Event event. It looks something like this in code:
TrackEntry trackEntry = _animState.SetAnimation(mainTrack, skillOneAnim, false);
trackEntry.Event += SkillOne;
trackEntry.Complete += delegate { TransitionCheck(); };
return trackEntry;
TransitionCheck is basically a big if else function that will switch states depending on whether or not the requirements are fulfilled for each individual character. It will direction call another function that is basically identical to the snippet above.
Now the problem lies in how sometimes the animation will initialize and start playing (It calls the Start event as well) but in reality the animation isn't playing. What I mean by that is that it enters say, for example, the animation for this character's skill one but the animation really playing is the previous animation that was set. The Event event and any other events on the trackentry are just seemingly discarded after the initial trigger of the Start event.
What confounds me is that it seems to be random for each character. Sometimes none of the characters can use their abilities, all they can do is loop attack and movement animations. Other times, one character can use their skills and others can't. And the changes seem to be happening randomly, without me changing anything to their controller.
One of the most peculiar problems I've encountered so far is that no matter what I do, none of the characters can use their Ultimate (Basically skill 0). I just don't understand why because their logic is identical to the other skills'.
Ok, I kinda ranted a bit there but I've been stuck on this for a week with no progress in sight. Here's a quick recap of all that I've noticed:
1. Recompiling the project files seems to give me different results from time to time. (As in skills being successfully used)
- ALL the characters have the exact same animation names and event names. Just so I won't get mixed up.
- When the problem occurs, the Start event of the Animation is triggered but nothing else. The correct animation doesn't play and the other events in said Animation don't trigger either.
- (Probably unrelated) Sometimes parts of the characters disappear during animations, also completely at random, or so it seems. It's always the same parts for the same characters. Like one character's face just disappears occasionally. Another just loses a hand and the shield he's holding.
Is there a known bug like this or am I just missing something super obvious in my code? I haven't had the time to pour over the forum yet...