- Home /
Animation doesn't play but controller works correctly (Legacy issues)
Hello all,
I've tried to google the very best out of it but I don't seem to find the solution. It seems to be such an incredibly simple thing, but Unity just has to glitch out on such a tiny thing.
I have a 2D Sprite to which I'm assigning different animations (all done through the Animation window). So far I only have two animations for this object are: Idle and Attack. Previews in the Scene window for each animation work just fine, but in the Game view, one of them won't play:
Idle will not play on entry if the two animations are not marked as Legacy but Attack plays fine when triggered
Attack won't play if both animations are marked as Legacy but Idle plays on Start
I've tried to debug through the Animator during Play but it seems to show transitions just fine, Idle is active on Entry and then Attack is triggered when it's supposed to be.
This is how I'm calling the Attack trigger (again, works perfectly in the Animator during Play but the animation will or not play depending on the legacy marker):
Enemy.Prefab.transform.Find("SpiritBody").GetComponent<Animator>().SetTrigger("SpiritAttack1");
Please help, I'm in utter loss.