구글링도하고 유튜브도 봐보고 했는데 점프가 구현이 안되더라고 


일단은 애니메이터는 이렇게 되어있고 

소스코드는 

using System.Collections;

using System.Collections.Generic;

using UnityEngine;


public class MyController : MonoBehaviour

{

    public enum State

    {

        Idle,

        Move,

        Jump,

        Skill,

        Slide,

    }


    float horizontalMove;

    float verticalMove;

    [SerializeField]

    private float _jumpPower = 5f;

    [SerializeField]

    private float _speed = 0f;


    float move_speed = 0;


    Rigidbody _rigidbody;

    Animator _animator;


    bool _isJumpping;


    Vector3 _movement;


    State _state = State.Idle;


    void Awake()

    {

        _rigidbody = GetComponent<Rigidbody>();

        _animator = GetComponent<Animator>();

    }


    void Update()

    {

        horizontalMove = Input.GetAxisRaw("Horizontal"); // 왼, 오

        verticalMove = Input.GetAxisRaw("Vertical");


        if (horizontalMove == 0 && verticalMove == 0)

        {

            move_speed = Mathf.Lerp(move_speed, 0, 10.0f * Time.deltaTime);

            _animator.SetFloat("Horizontal", move_speed);

            _animator.SetFloat("Vertical", move_speed);

            _animator.Play("MOVE_2D_Direction");

        }

        else

        {


            Move();

        }

        if (Input.GetButtonDown("Jump"))

        {

            Jump();

        }


        if (Input.GetKey(KeyCode.Z))

        {

            Skill();

        }

        if (Input.GetKey(KeyCode.LeftControl))

        {

            Slide();

        }

    }


    void Move()

    {

        if (horizontalMove == 0 && verticalMove == 0)

        {

            _state = State.Idle;

            return;

        }

        _movement.Set(horizontalMove, 0, verticalMove);


        if (Input.GetKey(KeyCode.LeftShift))

        {

            _speed = 10f;

            move_speed = Mathf.Lerp(move_speed, 1f, 10.0f * Time.deltaTime);

            _movement = _movement.normalized * _speed * Time.deltaTime;

        }

        else

        {

            _speed = 5f;

            move_speed = Mathf.Lerp(move_speed, 0.5f, 10.0f * Time.deltaTime);

            _movement = _movement.normalized * _speed * Time.deltaTime;

        }


        _rigidbody.MovePosition(transform.position + _movement);

        Quaternion quaternion = Quaternion.LookRotation(_movement);

        _rigidbody.rotation = Quaternion.Slerp(_rigidbody.rotation,quaternion,0.2f);


        _animator.SetFloat("Horizontal", move_speed);

        _animator.SetFloat("Vertical", move_speed);

        _animator.Play("MOVE_2D_Direction");



    }


    void Jump()

    {

        if (!_isJumpping)

        {

            _rigidbody.AddForce(Vector3.up * _jumpPower, ForceMode.Impulse);

            _animator.SetBool("IsJumpping", true);

            _animator.CrossFade("JUMP", 0.1f, -1, 0);

            _isJumpping = true;

        }


    }


    void Skill()

    {

        _animator.CrossFade("ATTACK", 0.1f, -1, 0);

    }


    void Slide()

    {

        _animator.CrossFade("SLIDE", 0.1f, -1, 0);

    }


    void OnHitEvent()

    {

        Debug.Log("Attack!");

    }



    private void OnCollisionEnter(Collision collision)

    {

        if(collision.gameObject.tag == "Floor")

        {

            _animator.SetBool("IsJumpping", false);

            _animator.SetBool("IsJumpping", false);

            _isJumpping = false;

        }

    }

}

일케 되있어 좌우이동 shift달리기는 잘되는데 달리다가 점프할때 애니메이션을 실행시키고싶은데 IsJumpping이 true로 바껴도 애니메이션이 흘러가지않네 공격이나 슬라이드도 마찬가지고 유니티초보라서 잘모르겠는데 귀띔좀 해줄수 있을까?