AlienController.Dodge C# (CSharp) Method

Dodge() public method

public Dodge ( ) : void
return void
    public void Dodge()
    {
        if (!GetComponent<Alien>().isDead)
        {

            bool hit = Physics.Raycast(transform.position, transform.TransformDirection(Vector3.right), 1.0f);

            if (hit) animator.SetBool("DodgeLeft", true);
            else animator.SetBool("DodgeRight", true);
        }
    }