a simple question related to Input.GetMouseDown(0)
i have a swords as a bool variable. i want to set it true every time i press left button of mouse. and set it to false when i am not pressing the left mouse button. my code works fine. it does as bool Sword to true when mouse button is pressed. but the problem is when my mouse tap speed is high some of my click is non being detected. i google but did not found a solution. below is the code.` void Update() {
if (Input.GetMouseButtonDown(0) == true)
{
swordSwinging = true;
Debug.Log("pressed");
}
else if (Input.GetMouseButtonUp(0))
{
swordSwinging = false;
Debug.Log("unpressed");
}
}`
Comment
Your answer