Jump to content

The type or namespace name 'Substance' could not be found (are you missing a using directive or an assembly reference?

Go to solution Solved by Peter,

Recommended Posts

I have an HDRP project running in Unity 2021.3.11f1 with tons off assets. I have installed Gaia 2021 latest version. I have removed a few assets that seemed to be in conflict with Gaia 2021. But, I'm still running into issues. I get a compilation error in tons of scripts referencing the "Substance" namespace which seems to be missing? I have no idea what this is. Is there ambiguity here? A conflict with another asset with the same namespace? Doesn't seem to be the case. But, creating a fresh HDRP project with Gaia 2021 works as expected. No "Substance" error.


Below is an example of the compilation error.



Assets\Procedural Worlds\Gaia\Scripts\ResourcesSystem\ResourceProtoTexture.cs(23,16): error CS0246: The type or namespace name 'Substance' could not be found (are you missing a using directive or an assembly reference?)


namespace Gaia
    /// <summary>
    /// Prototype for textures and their fitness
    /// </summary>
    public class ResourceProtoTexture
        [Tooltip("Resource name.")]
        public string m_name;
        [Tooltip("Resource texture.")]
        public Texture2D m_texture;
        public int substanceSourceIndex;
        public Substance.Game.Substance m_substanceMaterial;


The offending line:

"public Substance.Game.Substance m_substanceMaterial;"

Link to comment
Share on other sites

  • Solution

Hi @JimmyD, the offending line is referencing to code that should only be active if the Substance Plugin is active in the project. If you have never installed that plugin, and do not intend to use it, please open
Edit > Project Settings > Player
and remove the "SUBSTANCE_PLUGIN_ENABLED" scripting define from the scripting defines section


This should then omit the offending code block in compilation, and the code for the plugin should not be active anymore.

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

  • Create New...