Download

Following First Person Shooter C++ Tutorial, "ObjectInitializer" is unidentified error

I am on Unreal Engine 4.9.2. I’m following this tutorial with very little coding knowledge, dabbling with LUA in the past being my only experience with any sort of coding. Upon reaching this section of the tutorial, I’m receiving errors. They are as follows:

IntelliSense: type name is not allowed f:\Documents\Unreal Projects\FPSProject\Source\FPSProject\FPSCharacter.cpp
IntelliSense: identifier “ObjectInitializer” is undefined f:\Documents\Unreal Projects\FPSProject\Source\FPSProject\FPSCharacter.cpp
IntelliSense: expected a ‘;’ f:\Documents\Unreal Projects\FPSProject\Source\FPSProject\FPSCharacter.cpp

http://puu.sh/maQkX/610ecbb539.png

For reference, my code so far is in this zip file.

Your class has a normal AFPSCharacter() constructor. You cannot do that with UE´s managed classes, you need to use the FObjectInitializer constructor only.

These are just intellisense errors, it should compile fine.

Yeah Intellisense gets dumb fast when it comes to parsing gigantic codebase like UE4. Only care for errors that appear to make sense or those who actually prevents compilation.

Nope you can just call normal Default constructor and use the function CreateDefaultSubobject<Class T>(FName) and other similar functions without bothering with FObjectInitializer parameterised constructor