Search Unity

Stop Walk Animation if hits wall

Discussion in 'Animation' started by st4z, Sep 29, 2020.

  1. st4z

    st4z

    Joined:
    Jul 7, 2018
    Posts:
    3
    Stop Walk Animation if hits wall.
    I have Rigidbody and Root Motion. I just can't find right solution...


    https://pasteboard.co/JtkFY3X.png

    Code (CSharp):
    1. axisVertical = Input.GetAxis("Vertical");
    2. axisHorizontal = Input.GetAxis("Horizontal");
    3.  
    4. anim.SetFloat("Vertical", axisVertical);
    5. anim.SetFloat("Horizontal", axisHorizontal);
    Pls bro help
     
    Last edited: Sep 29, 2020