Input.getmousebuttonup(0) not returning true on fast clicks
I currently have a script that simply checks to see when the mouse is pressed and holds a bool true until it is released. Currently it holds true most of the time, but some quick sequential clicks will skip Input.getmousebuttonup(0) check. I've tried using Input.getmousebutton(0), but that will result in a true statement until another press is registered. The code previded down below is called by the update function. It should be noted that this is the ONLY input method that has this issue. Right click works perfectly fine. This feels like something that isn't really my fault, but if someone can shed some light on this issue that would be huge. (Note: The debug for the up input is skipped in these instances).
Version of Unity: 2021.2.8f1
Code:
void boostConditions()
{
if (Input.GetMouseButtonDown(0))
{
initiatedBoost = true;
Debug.Log("MOUSE DOWN PRESS");
}
if (Input.GetMouseButtonUp(0))
{
if (initiatedBoost)
{
initiatedBoost = false;
}
Debug.Log("MOUSE UP RELEASE");
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613055438im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
IME detection faulty on mac,IME detection on mac faulty 0 Answers
Input.GetMouseButtonDown not working in Play mode 0 Answers
InputSystem throws InvalidOperationException 2 Answers
Input problems in Unity 0 Answers
Game Kit Controller - no input 0 Answers