Контролер анімації

www.mixamo.com - FBX-персонажи

Adobe Fuse - програма для створення персонажів

    Animator anim;   // static

    public float speed = 10.0F;

    public float rotationSpeed = 100.0F;

    void Start(){

        anim = GetComponent<Animator>();

    }

    void Update(){

        float translation = Input.GetAxis("Vertical") * speed;

        float rotation = Input.GetAxis("Horizontal") * rotationSpeed;

        translation *= Time.deltaTime; 

        rotation *= Time.deltaTime;

        transform.Translate(0, 0, translation);  // гори потребують окремих колайдерів

        transform.Rotate(0, rotation, 0);

        

        

        if(Input.GetKeyDown(KeyCode.Space)) {

            anim.SetTrigger("isJump");

        }

        if(translation != 0 ){

            anim.SetBool("isWalk",true);

        }

        else{

            anim.SetBool("isWalk",false);

        }

        

    }

Тригер

Причіпити тригер до стрілки

Animator anim = GetComponent<Animator>();

anim.Play("Test1",0,0.5f);   // програвати з позиції

anim.speed = 0.1f;           // змінити швидкість

anim.enabled = false;      // виключити