Pointer error cant see what i have done wrong.

I have done this 1000 times and i have never had this before and cant see what i have done wrong.



	UPROPERTY(BlueprintReadWrite)
		AWeaponBase* WeaponBase;




#include "WeaponBase.h"

void AZombieSurvivalCharacter::BeginPlay() {
	Super::BeginPlay();

	WeaponBase->Character = this;
	WeaponBase->Character = Instigator;

}




	UPROPERTY(BlueprintReadWrite)
		AZombieSurvivalCharacter* Character;





#include "ZombieSurvivalCharacter.h"

void AWeaponBase::BeginPlay() {
	Super::BeginPlay();

	Character->WeaponBase = this;
	Character->WeaponBase = Instigator;
	
}


You’re missing some #includes in your .cpp file. The Compiler is telling you that when it starts compiling AWeaponBase, it doesn’t know what AZombieSurvivalCharacter is. “Missing Type Specifier” is the error that indicates this.

You need to add the relevant includes to the CPP files of both classes, then in the headers you need to add forward declarations. For example:

Under ‘Includes’ in WeaponBase.h



// Declarations
class AZombieSurvivalCharacter;


Under ‘Includes’ in ZombieSurvivalCharacter.h



// Declarations
class AWeaponBase;


Add to AWeaponBase.cpp



#include "ZombieSurvivalCharacter.h"


Add to ZombieSurvivalCharacter.cpp



#include "WeaponBase.h"