generated.h Not found by plugin


I’m using the Wwise plugin in my project and I want to create a sound occlusion/obstruction system,

So what I did is I created a class inheriting from “UPhysicalMaterial”, and added a SoundOcclusion float value. So that’s working great.

Now the problem is that in a class from the Wwise plugin I want to do a Raycast from the sound source to the listenner and if there is something on the way get the “Physical Material” of that object. So I included my UPhysicalMaterial child class (called TNHPhysicalMaterial) in the Wwise .cpp file to cast the original PhysicalMaterial and get my occlusion value like this :

if (OutHit.PhysMaterial != nullptr)
   UTNHPhysicalMaterial* PhysicalMaterial = Cast<UTNHPhysicalMaterial>(OutHit.PhysMaterial.Get());
   if (PhysicalMaterial)
       ListenerOcclusionInfo[ListenerIdx].TargetValue = PhysicalMaterial->SoundOcclusion;

Now first there is a problem when I include my class with this :

#include "TNHPhysicalMaterial.h"

It doesn’t find the file so what I did was this :

#include "../../../../../Source/TNH/TNHPhysicalMaterial.h"

So it finds it but tells me this :

"Cannot open include file “TNHPhysicalMaterial.generated.h” and the error leads me to the TNHPhysicalMaterial.h

I regenerated the visual studio project files and rebuild the solution but still have the error

Does anyone know what to do ?

Thanks :slight_smile:

Edit your .\Source\ProjectName\ProjectName.Build.CS and add the plugin dependency there.
I’m not sure on which of the sections it should go (PrivateIncludePaths, PublicDependencyModuleNames, PrivateDependencyModuleNames, DynamicallyLoadedModuleNames, PrivateIncludePathModuleNames), but one of them might work :slight_smile: