Animation Input / ETC

Hello i would like to ask about issue that i got what should i do im still newbie on this thing…


Question 1
How to make my Run animation can be Hold Key like (Left Shift) or ETC
i already tried with “Input.GetKey” but it did’t work so i make it to “Input.GetKeyDown” so the input actually like a Left Shift Toggle.


Question 2
(Look at the Picture)
![alt text][1]
it better config like the animation form the aniamtion tab or the Script it self? a lot i see in the Youtube some Youtuber use those method because they say “more easy” it that true??


Yup that all That i want to ask and here the


CODE

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Controller : MonoBehaviour
{
	public float Speed = 10f;
    public Animator anim;

    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
       PlayerMovement();
       InputCheck();  
    }

    void InputCheck()
    {
        if (Input.GetKeyDown(KeyCode.W))
            print("W Pressed!");
        if (Input.GetKeyDown(KeyCode.S))
            print ("S Presed!");
        if (Input.GetKeyDown(KeyCode.A))
            print("A Pressed!");
        if (Input.GetKeyDown(KeyCode.D))
            print("D Presed!");
    }

    void PlayerMovement()
    {
        anim.SetFloat ("Vertical", Input.GetAxis("Vertical"));
        anim.SetFloat ("Horizontal", Input.GetAxis("Horizontal"));

        if (Input.GetKeyDown(KeyCode.LeftShift))
        {
            print("Shift Pressed!");
            anim.SetTrigger("Run");

        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            print("Space Pressed!");
            anim.SetTrigger("Jump");
        }


        if (Input.GetKeyDown(KeyCode.C))
        {
            print("C Pressed!");
            anim.SetTrigger("Crouch");
        }

    }
}

Yeah im hoping that i can become Game Devoloper/Game Design/ETC some day’s actully im learning on my own

(im bit lazy to read the Documention because to long lol ) so i warp my head to think what code should do
if you guys can help me a lot!

You could do something like this:

public class Controller : MonoBehaviour
 {
     public float Speed = 10f;
     public Animator anim;
 
     
 
     // Update is called once per frame
     void Update()
     {
        PlayerMovement();
     }

     
 
     void PlayerMovement()
     {
         anim.SetFloat ("Vertical", Input.GetAxis("Vertical"));
         anim.SetFloat ("Horizontal", Input.GetAxis("Horizontal"));
 
         if (Input.GetKeyDown(KeyCode.LeftShift))
         {
             print("Shift Pressed!");
             //anim.SetTrigger("Run");
             anim.SetBool("Run", true);
         }else{
             anim.SetBool("Run", false);
         }

         // ...
     }
 }

I hope it helps.