Super simple script:
public class MouseTest : MonoBehaviour
{
private bool lastHeld;
public void Update()
{
var isHeld = Input.GetMouseButton(0);
if (isHeld != lastHeld)
{
Debug.Log($"Frame: {Time.frameCount}, Held: {isHeld}");
lastHeld = isHeld;
}
}
}
Steps to recreate:
- Run game
- Click (value changes to true )
- Release → (value changes to false )
- Click clear in editor log below (losing focus on game)
- Click back in game (value changes to true, then false next frame! )