Search Unity

Question Problem with the Start() function

Discussion in 'Scripting' started by julien83franceschi, Feb 13, 2024.

  1. julien83franceschi

    julien83franceschi

    Joined:
    Nov 14, 2020
    Posts:
    232
    My question is quite simple:
    why is AfficherGrille underlined in red in the void Start() function?

    Code (CSharp):
    1. void Start()
    2.     {
    3.        AfficherGrille();
    4.     }
    5.  
    6.     void AfficherGrille()
    7.     {
    8.         for (int i = 0; i < 8; i++)
    9.         {
    10.             string row = "";
    11.             for (int j = 0; j < 8; j++)
    12.             {
    13.                 row += grid[i, j] + " ";
    14.             }
    15.             Debug.Log(row);
    16.         }
    17.     }
    Voici une image:



    Thanks for your help,

    A+
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,662
    Read the error message: it is telling you it is ambiguous between two different functions of that name (AfficherGrille).

    Look at your other function by this name and either rename it or otherwise make it unambiguous.