Search Unity

Debug.Log not working

Discussion in 'Scripting' started by Anbush18, Jun 22, 2020.

  1. Anbush18

    Anbush18

    Joined:
    Jun 22, 2020
    Posts:
    2
    Hi there,

    I'm trying to start coding with Visual Studio and idk why when I try to debug I get this error (in Unity)...

    Code (CSharp):
    1.     void Start()
    2.     {
    3.         Debug.Log("test");
    4.  
    5.     }
    Assets\_Scripts\MyFirstScript.cs(31,9): error CS0104: 'Debug' is an ambiguous reference between 'UnityEngine.Debug' and 'System.Diagnostics.Debug'
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,909
    Remove "using System.Diagnostics;" from the top of your file. You added it by accident.
     
    Anbush18 likes this.
  3. Anbush18

    Anbush18

    Joined:
    Jun 22, 2020
    Posts:
    2

    It worked, thank you!