I’m creating a small idle game like cookie clicker. I’ve only just added the main button to click and earn points but instead of adding 1 point it adds 2. I think it’s the refresh rate of the scene but I was wondering how I could fix it.
`
void OnMouseOver()
{
if (Input.GetMouseButtonDown(0)
{
totalClicks++;
}
}
void Update()
{
OnMouseOver();
}
`
All I’m doing is increasing the totalClicks and printing it out with a text ui but for some reason it adds 2 points instead of 1. Thanks for the help.