Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Animation Snapping

Discussion in 'Animation' started by madeer, Aug 16, 2020.

  1. madeer

    madeer

    Joined:
    Aug 2, 2018
    Posts:
    5
    Hi,
    im trying to figure out why my animation is snapping as shown in the video below. This is how im handling most of animations, i can't find a reason for this happening. Furthermore if i spam my Roll button the snapping seems to fix itself and its not happening at all anymore.
    Tank you for any suggestions.



    Code (CSharp):
    1.       public void PlayTargetAnimation(string targetAnim, bool isInteracting)
    2.         {
    3.             anim.applyRootMotion = isInteracting;
    4.             anim.SetBool("isInteracting", isInteracting);
    5.             anim.CrossFade(targetAnim, 0.2f);
    6.         }