Linker Error with class Constructor when extending ANavModiferVolume

Hello,

Im getting a Linker error (LNK2019) when trying to extend the class ANavModifierVolume. I wish to spawn NavMeshModifiers at Runtime and modify path costs (by changing to Nav Area class) at runtime also. I can not seem to create a default constructor for my class, using a standard unreal 4 way of defining and declaring my constructor (an ObjectInitalizer)

Below a screenshot, has anyone got any advice on fixing this issue? (Imgur link: http://imgur.com/JX2KRdf )

The problem is that ANavModifierVolume has been tagged in the engine as a MinimalAPI (see NavModifierVolume.h) meaning you can only cast to it but can’t call its functions or subclass it. Many classes in the engine (especially those that are considered as unlikely to be subclassed by users) have been marked this way to improve compilation times.

If you really want to go down this route you can modify the engine source to

  1. Remove the MinimalAPI tag from the class and
  2. Make sure it is “exported” by adding the relevant API name (most likely “ENGINE_API”) after the class keyword and before the class name.

However I’d just change the design if I were you; perhaps spawn the default nav modifier but then manipulate its properties externally using another class. I haven’t used Nav Modifiers extensively so I’m not able to offer a detailed design alternative for what you’re trying to do.

Reading this i think a change in design is best, thanks