Home Game Development Walk Animation Problem Only When I Go To The Right

Walk Animation Problem Only When I Go To The Right

0
Walk Animation Problem Only When I Go To The Right

[ad_1]

So, here is my downside. I’ve created two animations: “Walk” and “Idle” and I made the transitions from “Idle” to “Walk” and from “Walk” to “Idle” as nicely. So, the issue is, after I go the the left facet the “Walk” animation is being performed, however after I go to the precise, the animation would not work.
Here is my Movement Function:

void ParticipantMovement()
    {
        tempPos = rework.place;
        float h = Input.GetAxisRaw("Horizontal");

        if (h > 0)
        {
            //tempPos.x += pace * Time.deltaTime;
            animator.SetBool("WalkParam", true);
            //sr.flipX = false;

        }
        if (h < 0)
        {
            //tempPos.x -= pace * Time.deltaTime;
            animator.SetBool("WalkParam", true);
            //sr.flipX = true;
        }
        else
        {
            animator.SetBool("WalkParam", false);
        }
        rework.place = tempPos;
    }

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here