Would like to know if I doing well the animation transition?

I learning animation transition with blend tree and Game Object movement system with that animation. My friend create a 3D model and few animation in blender. I wrote scripts for movement system and camera follow. It’s working good enough as you can see on video DroneMovingDemo - YouTube. However, I have animation that roll drone right and left, in my idea, drone should call roll animation and after call idle after roll done, that when i push “A” or “D” my Game Object turn left or right with roll and after moving as idle. I created variable that save a Vector3.Dot function with vector of drone and vector of camera, that allow me detect drone turning, but I think I made crazy things in my animator

    //variable initialization
    public float InputX;
    public float InputZ;
    public Vector3 desiredMoveDirection;
    public bool bloclRotationPlayer;
    public float speed = 12f;
    public float desiredRotationSpeed = 10f;
    public CharacterController controller;
    Vector3 velocity;
    public float allowPlayerRotation;
    public Animator anim;
    public Camera cam;
    public float gravity = -9.6f;
    public float verticalVel;
    private Vector3 moveVector;
    public Transform groundCheck;
    public float dist = 0.4f;
    public LayerMask groundMask;
    public float jumpH = 60f;
    Vector3 mVelocity;
    Vector3 droneRotation;
    bool isGrounded;
    public float movingSpeed = 20f;
    public bool CheckAnimFalling = false;
    public Vector3 objPos;
    CameraLook CameraLook;
    public float scalarMultForw;

    Vector3 moveDir;

    private void Start()
        anim = GetComponent<Animator>();
        cam = Camera.main;
        controller = this.GetComponent<CharacterController>();
    void Update()
        //get some input
        InputX = Input.GetAxis("Horizontal");
        InputZ = Input.GetAxis("Vertical");
        //save Inputs in variables
        moveDir = new Vector3(InputX, 0 , InputZ);
        //define obj Position
        objPos = transform.forward;
        //Vector3.Dot with camera vector and drone vector
        scalarMultForw = Mathf.Round(Vector3.Dot(Camera.main.transform.right, objPos.normalized) * 100) / 100;
        //calling method that define the magnitude
        //jump staff
        if (Input.GetKey(KeyCode.Space))
            verticalVel = Mathf.Sqrt(jumpH * -2f * gravity);

        isGrounded = controller.isGrounded;
        if (isGrounded)
            verticalVel -= 0;
            CheckAnimFalling = true;
            verticalVel -= 2;
            CheckAnimFalling = false;
        //move controller via jump or falling
        moveVector = new Vector3(0, verticalVel * Time.deltaTime, 0);
    void PlayerMoveAndRotation()
        //method for define drone moving vector 
        var camera = Camera.main;
        var forward = cam.transform.forward;
        var right = cam.transform.right;

        forward.y = 0f;
        right.y = 0f;

        desiredMoveDirection = forward * InputZ + right * InputX;
        Vector3 moveDir = desiredMoveDirection.normalized * movingSpeed * Time.deltaTime;
        controller.Move(moveDir * Time.deltaTime * 100f);
        //rotate Drone to direction if I move it
        if (bloclRotationPlayer == false)
            transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(desiredMoveDirection),desiredRotationSpeed * Time.deltaTime * 0.2f);
    void InputMagnitude()
        //method that control blend tree in the animator
        anim.SetFloat("InputZ", InputZ, 0.0f, Time.deltaTime * 2f);
        anim.SetFloat("InputX", InputX, 0.0f, Time.deltaTime * 2f);
        //checking if we stay or moving 
        speed = new Vector2(InputX, InputZ).sqrMagnitude;

        if (speed > allowPlayerRotation)
            anim.SetFloat("InputMagnitude",speed,0.0f, Time.deltaTime);
            anim.SetFloat("TurnCheck", scalarMultForw, 0.0f, Time.deltaTime);
        else if(speed < allowPlayerRotation)
            anim.SetFloat("InputMagnitude", speed, 0.0f, Time.deltaTime);


I guess I’m crazy, and make it wrong, can you help and give advise how work with animation, blend tree, transition correctly. How make create transition that Drone firstly roll to side and after that move as idle animation? If you need more material, just say

You are not using the animator correctly. Blend trees are a tool for another purpose. A good example is variable movement speed of the player.

Let’s say you have two animations for your player - running, and sprinting. But during gameplay, your player can move at any arbitrary speed between those two speeds. In that case, blend tree will kind of “make up” what animation between the two values might look like for any given speed between those two.

What you are trying to do is simple state transitions between any two well defined, and known states. This is what your normal animator does already. You need to simply set up your animation clips as states and call them from code (I find calling state names from code is much cleaner than using numerous parameters).

An example of how I would do you setup:
[Roll Left] - > [Idle]
[Roll Right] → [Idle]
(Note no transitions go INTO rolls).

Then, from code, simply call anim.Crossfade(string, float), where string is your state name as it appears in animator, and float is amount of seconds the crossfade will take (you probably want small values like 0f or 0.1f). More info: Unity - Scripting API: Animator.CrossFade