Trying To Get One Camera Per Second In A Clicker Game,I'm making A Clicker Game But +1 per Second Not Working

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class AutoScript : MonoBehaviour
{
void Start()
{

    if(PurchaseAutoOnClick.PurchaseClicked >1)
    InvokeRepeating("GiveCamera", 1, 1f);

}


public void GiveCamera()
{
    CameraAmount.CameraAmounts += 1;
}

}

It Only Gives Me one Every Time I Click The Purchase Button,using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class AutoScript : MonoBehaviour
{
void Start()
{

    if(PurchaseAutoOnClick.PurchaseClicked >1)
    InvokeRepeating("GiveCamera", 1, 1f);

}


public void GiveCamera()
{
    CameraAmount.CameraAmounts += 1;
}

}

It’s Not Working It Just Gives Me One Camera Per Second

I guess you actually want something like this instead:

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class AutoScript : MonoBehaviour
{
    void Start()
    {
        InvokeRepeating("GiveCamera", 1, 1f);
    }
    public void GiveCamera()
    {
        CameraAmount.CameraAmounts += PurchaseAutoOnClick.PurchaseClicked;
    }
}

Start is only called once at the very start of the game. So your InvokeRepeating would not execute unless your “PurchaseClicked” value is greater than 1 (so 2 or higher). If the value changes later, the InvokeRepeating would not magically be started then. Again, Start is only called once. What I did is I start the InvokeRepeating immediately. Assuming “PurchaseClicked” is 0 initially, when we add 0 to “CameraAmounts”, nothing would change. However as PurchaseClicked is increased we add that amount each second.

Thanks
Ill Try Now