Greetings, Im having issues with my animations. The if conditions are met because I can see debug.logs on console. But for some reason my animations are not playing. I have tried some things but I could not find any solutions.
Greetings, Im having issues with my animations. The if conditions are met because I can see debug.logs on console. But for some reason my animations are not playing. I have tried some things but I could not find any solutions.
It’s difficult to see from your screenshots, but if you’re running the PlayTargetAnimation()
method more than once, the animation is going to freeze because you’re using Animator.CrossFade()
.
If that’s the issue, then this should probably work:
public void PlayTargetAnimation(string targetAnimation, bool isInteracting)
{
animator.SetBool("isInteracting", isInteracting);
if (!animator.GetCurrentAnimatorStateInfo(0).IsName(targetAnimation) && !animator.GetNextAnimatorStateInfo(0).IsName(targetAnimation))
{
animator.CrossFade(targetAnimation, 0.2f);
}
}
This checks that you’re not already in or moving to a state before crossfading. I think the reason is freezes is that you start a transition while in a transition or something. Honestly, I’m not entirely sure how it even works, but this should fix it.
Thank you for your reply, unfortunately this did not solve it. But I found that if I remove my landing animation (turn it to idle anim.) my character does the falling animation. Still no landing animation tho, If I were to add it my character freezes again