Custom package's namespace isn't recognized by Unity or VS

This is my first package and I have been stuck on trying to access the classes in my two scripts for some time now. I have a namespace, CoolStuff, and two static classes I’m trying to reference with it: UsefulStuff and MathStuff. When trying to access the namespace from another script, however, the namespace isn’t recognized by Visual Studio or Unity, and they both send an error. I have a feeling this might have to do with the fact that Unity namespaces aren’t recognized by either script in the packages folder and neither Unity nor Intellisense is sending compiler errors for them. Because of this, I replicated the debug I made in another script that’s in the resources/scripts folder (see below) and it works perfectly fine. But I’ve been searching for a long time and can’t find any closely related issues, so any ideas you might have would be great!


UsefulStuff, for example (doesn’t work):

using System;
using System.Collections;
using System.Reflection;
using UnityEngine;

namespace CoolStuff {
    /// <summary>
    /// Contains a wide variety of useful functions
    /// </summary>
    public static class UsefulStuff {
        public static oid CallDebug() {  //"oid" sends no error to either Unity or VS
            //Debug.Log is whited out and not recognized by VS, but still, no error is sent
            Debug.Log("Called CallDebug() in UsefulStuff"); 
        }

        // other functions
    }
}

A replication outside of the packages folder (does work):

using UnityEngine;

namespace CoolerStuff {
    public static class GeneralDebug {
        public static void CallDebug() {
            //Debug.Log is colored and recognized
            Debug.Log("Called CallDebug() in GeneralDebug");
        }
    }
}

CoolStuffDebug on a GameObject trying to do each debug function:

using CoolerStuff;  // no error
using CoolStuff;    // error
using UnityEngine;

public class CoolStuffDebug : MonoBehaviour {
    private void Start() {
        GeneralDebug.CallDebug();  // no error and sends log
        UsefulStuff.CallDebug();   // error and no log
    }
}
1 Like

@KingTempest07 I am facing similar issue. Please let me know if you found out any solution for it ?