i made a joystick that triggers an animation while controlling the player to move in that direction. so i searched on your youtube and they used quaternion to solve it. it did solve my problem but it started making the screen shake anytime i move. what can i do???
heres the code
void joystickControls()
{
if (joy.Horizontal != 0f || joy.Vertical != 0f)
{
anim.GetComponent<Animator>().Play("WalkForward");
transform.rotation = Quaternion.LookRotation(rb.velocity);
}
if (joy.Horizontal == 0f && joy.Vertical == 0f)
{
anim.GetComponent<Animator>().Play("Idle");
}
}