Search Unity

Problem with this Script

Discussion in 'Scripting' started by Deleted User, Jun 18, 2019.

  1. Deleted User

    Deleted User

    Guest

    When I typed this script
    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3.  
    4. public class Script : MonoBehaviour
    5. {
    6.     // Start is called before the first frame update
    7.     public void ClickTest()
    8.     {
    9.         debug.log("HI");
    10.     }
    11.  
    12.     // Update is called once per frame
    13.     void Update()
    14.     {
    15.        
    16.     }
    17. }
    18.  
    it gives me this error
    "Assets\Script.cs(9,3): error CS0103: The name 'debug' does not exist in the current context"
    Please Help
     
  2. AnKOu

    AnKOu

    Joined:
    Aug 30, 2013
    Posts:
    123
    Debug.Log

    Should write code with visual studio or other IDE. It helps a lot with typos.
     
    Joe-Censored likes this.
  3. Deleted User

    Deleted User

    Guest

    I am using Visual Studios 2019 but thanks it worked
     
  4. EdGunther

    EdGunther

    Joined:
    Jun 25, 2018
    Posts:
    183
    Debug.Log("Hello, World");


    I fixed your code
     
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    VS would have pointed out the error as soon as you typed it then.
     
    Vryken likes this.