Hello, I’m new to posting over here. Hopefully this follows the correct general formatting that it’s meant to. I’m just wondering what I need to #include in my header to be able to use the ADestructibleActor object. I’ve tried #include “DestructibleComponent.h” and #include “Components/DestructibleComponent.h” to no avail. This is after manually re-enabling the ApexDestruction plugin in both places (uproject and program files). I’m stuck, now…
I’ve already done/tried both of those things, neither worked. I have “ApexDestruction” referenced in my build CS, I’ve already attempted to use that import in the header to no avail and I’ve also made the required edit to my .uproject. None of that has worked.
The engine API docs are a good place to look for header files.
At bottom of this page you can see the path for the class you’re searching for, here:
http://api.unrealengine.com/INT/API/Runtime/Engine/PhysicsEngine/ADestructibleActor/index.html
Header: Runtime/Engine/Classes/PhysicsEngine/DestructibleActor.h
So you can just do something like:
#include "Runtime/Engine/Classes/PhysicsEngine/DestructibleActor.h"
_
If Builder Tool complains the header can’t be found, then you have to reference in your Build.cs file the module that header is a member of, in this case the “Engine” module:
PublicDependencyModuleNames.AddRange(
new string[] {
"Core",
"Engine",
"CoreUObject",
}
);
Ahh it worked, you’re a lifesaver!
Ok, never mind. Essentially, the solution is to delete the .sln file that governs the project, in Visual Studio, and then rebuild it from the .uproject file by right clicking it in file explorer. Then, when referencing the header, you merely have to refer to it as #include “DestructibleActor.h” and all is well.
I had the same problem, fix it by adding this to the .uproject file
““AdditionalDependencies”: [
“ApexDestruction”
]”
In modules section.