error CS0111: Type 'AutoEaterBuy' already defines a member called 'Update' with the same parameter types

Can someone help me with this i can see the error?

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

public class AutoEaterBuy : MonoBehaviour
{

public GameObject FakeButton;
public GameObject FakeText;
public GameObject RealButton;
public GameObject RealText;
public static int CurrentDollars;
public static int AutoEaterValue = 20;
public static bool TurnOffButton = false;
public GameObject AutoEaterStats;
public static int NumberOfAutoEater;
public static int AutoEaterPerSec;

void Update()
{
    CurrentDollars = Dollars.dollars;
    AutoEaterStats.GetComponent<Text>().text = "Auto Eaters: " + NumberOfAutoEater + " @ " + AutoEaterPerSec + " Per Second";
    FakeText.GetComponent<Text>().text = "Auto eater - $" + AutoEaterValue;
    RealText.GetComponent<Text>().text = "Auto eater - $" + AutoEaterValue;
    if (CurrentDollars >= AutoEaterValue)
    {
        FakeButton.SetActive(false);
        RealButton.SetActive(true);
    }

    if (TurnOffButton == true)
    {
        RealButton.SetActive(false);
        FakeButton.SetActive(true);
        TurnOffButton = false;
    }
}

}

Are you sure:

  • This is your whole script and there isn’t any other method in the same class.
  • you actually saved your recent changes.
  • you don’t have another script somewhere in your project with the same name.

The error will pop up when you have two or more methods with the same name. In your case it seems you have two Update methods defined in the same class. This is not possible. Though the script you’ve posted only contains one Update method. So either you didn’t poste the right / complete script or you haven’t saved your recent changes and you previously had two Update methods.