I’m trying to detect two different mouse click but only a single mouse click is detected twice, I don’t know whats wrong with the code but I can’t detect two separate mouse clicks
bool click = true;
void Update()
{
if(click)
{
if(Input.GetMouseButton(0))
{
print ("Click1");
click = false;
}
}
else
{
if(Input.GetMouseButton(0))
{
print ("Click2");
}
}
}
On single mouse click, I got “Click2”, it should be giving “Click1”, can anyone explain why I’m getting “Click2” on first mouse click
Edit: copy paste, “update()” function mistake corrected to “Update()”