A silly bug of a noob :( I need help. error CS0117: 'Debug' does not contain a definition for 'log'

Hi, I’m following a tutorial (a bit old) and I have a problem in the following script:

```csharp
*using UnityEngine;

public class Player_Colosion : MonoBehaviour
{
void OnColissionEnter()
{

    Debug.log ("We hit something");

}
}*

```

The version of my unity is 2018.4.11f1 (64-bit) and im following this tutorial:

I don’t know if it’s my mistake or if debug.log is no longer used like that.

Carefully check your capitalization and spelling. Debug.Log has the wrong capitalization, and OnCollisionEnter is misspelled (which would not generate an error, but it wouldn’t work either).

3 Likes

You beat me to the first one (was typing up the response as you posted), but I totally missed the method being off. :stuck_out_tongue:

2 Likes

Thankss, you are awesome <3

omfg i spent 20 mins debugging for a capitalization error iwtfd

I have the same problem too, with these two scripts:

using UnityEditor;
using UnityEngine;

public static class HandleUtilityProxy
{
    public static GameObject FindSelectionBase(GameObject gameObject)
    {
        return HandleUtility.FindSelectionBase(gameObject);
    }
}

and:

using UnityEditor;
using UnityEngine;

public static class AudioUtilProxy
{
    public static void PlayClip(AudioClip audioClip)
    {
        AudioUtil.PlayClip(audioClip);

I hate to be pedantic but you spelt collision wrong for one.

Check and double check your spelling when writing code, the slightest typo and it won’t thank you, as I discovered doing a “Hello World” C# tutorial last week from a book.

A proper IDE (Visual Studio or Rider) will autocorrect this for you.

Im having a similar issue this is my script and i do not know how to fix it.Assets\PumkinsAvatarTools\Scripts\Editor\Destroyers\LegacyDestroyer.cs(98,28): error CS0117: ‘Helpers’ does not contain a definition for ‘DestroyMissingScriptsInGameObject’ and this is the script where it tells me it is.

 var ts = avatar.GetComponentsInChildren<Transform>(true);
            foreach(var t in ts)
            {
                if(Helpers.DestroyMissingScriptsInGameObject(t.gameObject))
                    PumkinsAvatarTools.Log(Strings.Log.hasMissingScriptDestroying, LogType.Log, Helpers.GetTransformPath(t, avatar.transform));
            }