Expression must have a class type, creating a class reference.
I'm currently trying to setup a reference to my Gamemode in one of my classes:
For some reason this:
Gives me an error that "GameMode" needs a class type? I really don't get what it means, any clues?
I'm guessing I have to use the member access operator in some way, but I'm unsure of the syntax.
I've been looking at this example: http://www.tutorialspoint.com/cplusplus/cpp_pointer_to_class.htm and tried GameMode->Gravity, but then it gives me a "Pointer to incomplete class" error? But as you can see, it's defined in the header?
I see a couple of errors in the code:
On BeginPlay you are declaring and defining GameMode again. You should define the GameMode you already declared in the header file in the constructor of your character class
GameMode is a pointer, so you should be getting its members by using ->
Anyways I would recomend you to not declare a GameMode variable on your header and just creating a pointer when needed. In your case:
Follow this question
Once you sign in you will be able to subscribe for any updates here