// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "DWGameCharacter.generated.h"
class AWeapon;
UCLASS(config=Game)
class ADWGameCharacter : ACharacter
{
GENERATED_UCLASS_BODY()
AWeapon* CurrentWeapon
// other non relevant vars
};
and the .cpp stays pretty much the same, yet when i try to compile i still get the error about using a undefined type, if i include the Weapon.h in my ADWGameCharacter.cpp i can compile fine but
The game crashes as soon DefaultInventory() is called
Without the call stack it is difficult to be sure, but most likely the GetWorld() call is returning NULL because you are calling that function at a time when the world cannot yet be determined.
Yes, you need to include it’s header if you want to use it, not just spawn.
There may be a way of grouping all the game headers together into one file and just using that, but I’m not sure if that’s recommended. I know with my setup in the Beta build I didn’t seem to need to include all the headers and they were recognized, but I’ve had to add them all with the release.