Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

The type `Menu' already contains a definition for `Start'

Discussion in 'Scripting' started by DanSingh, Aug 22, 2015.

  1. DanSingh

    DanSingh

    Joined:
    Feb 5, 2015
    Posts:
    98
    Well I have a script but I kept getting the error.The type `Menu' already contains a definition for `Start'. I trued looking for other references but it points me to the script.
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.UI;
    4.  
    5. public class Menu : MonoBehaviour
    6. {
    7.     public Canvas ExitMenu;
    8.     public Button Start;
    9.     public Button exit;
    10.     // Use this for initialization
    11.     void Start ()
    12.     {
    13.  
    14.     }
    15. }
    16.  
     
  2. lineupthesky

    lineupthesky

    Joined:
    Jan 31, 2015
    Posts:
    92
    Do not name your variable as "Start". Change it to something else.
     
  3. DanSingh

    DanSingh

    Joined:
    Feb 5, 2015
    Posts:
    98
    I want to to start. Like when it starts I want to to do something.
     
  4. lineupthesky

    lineupthesky

    Joined:
    Jan 31, 2015
    Posts:
    92
    I mean change the second variable's name over here :

    Code (CSharp):
    1.  public Canvas ExitMenu;
    2. public Button Start;
    3. public Button exit;
    Instead of this:

    Code (CSharp):
    1. public Button Start;
    write this:

    Code (CSharp):
    1. public Button First;
     
  5. DanSingh

    DanSingh

    Joined:
    Feb 5, 2015
    Posts:
    98
    I didn't even realize thanks.