ANavigationObjectBase undefined

I’m trying to override the “ChoosePlayerStart” function in my game mode, using the same code used in the ShooterGame project. However, I have to manually #include “GameplayFramework/PlayerStart.h”, but then I get the following compile error:

1>C:\Program Files\Unreal Engine\4.4\Engine\Source\Runtime\Engine\Classes\GameFramework/PlayerStart.h(12): error C2504: 'ANavigationObjectBase' : base class undefined

This seems very odd to me, since the same code works fine in the shooter game. I’d like to avoid changing the PlayerStart code if possible…what can I do?

Hi veggiesaurus,

Could you provide more information about what you are doing? Did you copy the ChoosePlayerStart code directly from ShooterGame and paste it into your project?

Also, what version of the Editor are you using, and is your Engine the binary version installed by the Launcher, or did you build it from source code?

Hi veggiesaurus,

After some initial investigation, I have managed to duplicate the issue that you described. I have also found a workaround for you. Open the PlayerStart.h file in your Engine installation and add the following include:

#include "Engine/NavigationObjectBase.h"

I still need to find out why this is necessary, but that line should clear up the error messages you are seeing.

I had the same problem, and adding that include fixed it for me, as well. I had the same reluctance to modifying engine code, though.

You can also add that line in your own code, just before #including PlayerStart.h
Feels dirty, though…