Ejemplo n.º 1
0
    private void Moving()
    {
        if (animController.isAttacking && playerFeet.grounded || playerController.isBlocking)
        {
            speed = 0;
        }
        else
        {
            speed = privateSpeed;
        }

        x = Input.GetAxis("Horizontal") * Time.deltaTime * speed;

        Vector2 movement = new Vector2(x * speed, rb2D.velocity.y);

        rb2D.velocity = movement;

        if (Input.GetKeyDown(KeyCode.Space) && playerFeet.grounded == true)
        {
            Jump();
        }

        //DashLogic();
        animController.AnimationHandler(x);
    }
Ejemplo n.º 2
0
    private void Moving()
    {
        if (animController.isAttacking && playerFeet.grounded || playerController.isBlocking)
        {
            speed = 0;
        }
        else
        {
            speed = privateSpeed;
        }

        FootSteps();

        x = Input.GetAxis("Horizontal") * Time.deltaTime * speed;

        Vector2 movement = new Vector2(x * speed, rb2D.velocity.y);

        rb2D.velocity = movement;

        //DashLogic();
        animController.AnimationHandler(x);
    }