Download

Very strange error after addind c++ to project [RESOLVED]

I’m having a bit of trouble while adding C++ to my project.
I’m getting an error that as no explanation. After addind C++ I started getting this error while loading my project.

/Script/CableComponent : [AssetLog] …\CMP_SliddingCableComponent.uasset: Failed to load ‘/Script/CableComponent’: Can’t find file. /Script/CableComponent

If I open the BP where the Cable component is referenced, the cable is nowhere to be seen.

I’m sure this is related with the C++ project because if I remove that module from the uproject file the error disappears and everything loads fine.

I googled and I found about the build.cs file.
I tried add a reference to the Cable Component like this:

PublicDependencyModuleNames.AddRange(new string[] { “Core”, “CoreUObject”, “Engine”, “InputCore”, “CableComponent” });

But it didn’t work.

The output log shows this error:
LogPluginManager: Mounting plugin CableComponent
LogLinker: Warning: [AssetLog] …\CMP_SliddingCableComponent.uasset: Failed to load ‘/Script/CableComponent’: Can’t find file.
LogLinker: Warning: [AssetLog] …\CMP_SliddingCableComponent.uasset: Failed to load ‘/Script/CableComponent’: Can’t find file.
LoadErrors: Error: /Script/CableComponent : [AssetLog] …\CMP_SliddingCableComponent.uasset: Failed to load ‘/Script/CableComponent’: Can’t find file. /Script/CableComponent

Edit:
I do have “Script” folder on my project root but it’s empty.

No idea what is happening here.

I mananaged to solve this one.

I found this topic in the forum:
C++ and blueprints compile but “Failed to load: Can’t find file” on building pixelstreaming project. - Development Discussion / Blueprint Visual Scripting - Unreal Engine Forums

I changed the following in the engine file “CableComponent.uplugin”:

“LoadingPhase” : From “Default” to “PreDefault”.

Is this a bug in the Engine?
I’m using UE5.