Download

Inheriting from ACameraActor in *Plugin* gives compile errors in ACameraActor base class

My guess here is that I need to do something different/special to derive from things like Actors and Components in a plugin?

When I try to inherit from ACameraActor in my plugin code (The end goal is to create a new custom asset type based on the base ACameraActor and UCameraComponent, but in a plugin), I get tons of errors in the base camera actor code, really silly errors that obviously shouldn’t be happening (such as ACameraActor.h complaining it doesn’t know what AActor is). The same custom class compiles fine when not in a plugin.

Anyone have any idea what step(s) I am missing to make this compile inside of a plugin?

Ok so definitely different steps needed for a plugin. It seems that somehow your game code has a different build environment or something. In my plugin I have manually edited the build file to add dependencies for Core and Engine, and added GameFramework/Actor.h to my header, and that has cleaned up some but not all of the compile errors.

Unfortunately at this point it feels very trial and error tryign to figure out what dependencies I need and what includes I need. Surely there is a better way?

Ok, I finally got it working!

I had to add an include for Engine.h to my Plugin’s PCH

Having problems now with a totally different part of the engine, but same problem, base engine stuff not compiling because I am missing something somewhere but have no way to find out what I am missing. there has to be a better way!?

How do I know what I need to add to my build rules? How do I know what I need to add to the PCH? My current issue is with the pieces needed for customizing the PropertyEditor

Did you ever get to the bottom of this? I’ve hitting a similar problem at the moment. Just delving into Plugin creation now and C++ throws a complete illiterate wobbly if I try and create a class that inherits from UWidgetComponent. Other GameFramework classes like GameInstance and PlayerController are fine…

@Wobbleyheadedbob Make sure that you have the proper modules included for you project/plugin in the .Build.cs file. For widgets, that would be “UMG”.


PrivateDependencyModuleNames.AddRange(new string] { "UMG" });

Yeah, I managed to fix it just before you replied! Thanks.