In the Editor and after building the game on Very-Low Quality (although I can easily run max quality), whenever I press a button, it takes maybe 300ms to actually register the input. And when I tap semi-quick my sprite moves but doesn’t animate.
I’m pretty new and am tired of looking for so long so I posted here. The problem seems to be that it’s taking a while for my animator to receive the boolean (double-checked in animator window).
Oh, and not to forget, my movement script is not affected by this problem although it also uses Input.GetAxis. However, it is a one-liner.
public class RunningAnimation : MonoBehaviour
{
public bool isRunning;
public Animator anim;
bool flipX;
// Start is called before the first frame update
void Start()
{
anim = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
float moveDirection = Input.GetAxis("Horizontal");
switch (moveDirection)
{
case 0:
isRunning = false;
break;
case 1:
isRunning = true;
flipX = false;
break;
case -1:
isRunning = true;
flipX = true;
break;
}
anim.SetBool("isRunning", isRunning);
this.gameObject.GetComponent<SpriteRenderer>().flipX = flipX;
}
}