So this is my first project using engine 4.6. I beleive i’ve satisfied all the changes from 4.5, but I cannot fix the error in the title. Here are my .h and .cpp files:
BoidPawn.h
#pragma once
#include "GameFramework/Pawn.h"
#include "BoidPawn.generated.h"
/**
*
*/
UCLASS()
class ZOMBIE_SHOOTER_API ABoidPawn : public APawn
{
GENERATED_BODY()
public:
/** Constructor */
ABoidPawn(const class FObjectInitializer& ObjectInitializer);
/** Separation volume */
UPROPERTY(VisibleDefaultsOnly, Category = Movement)
USphereComponent* SeparationSphere;
/** Neighbour volume */
UPROPERTY(VisibleDefaultsOnly, Category = Movement)
USphereComponent* NeighbourSphere;
/** Updates the pawn */
void Update();
/** Checks if the pawn is overlapping with any other boid_pawn */
bool IsOverlapping();
};
BoidPawn.cpp
#include "Zombie_Shooter.h"
#include "BoidPawn.h"
ABoidPawn::ABoidPawn(const class FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
// create a separation volume used to detect collision
SeparationSphere = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(this, TEXT("SeparationSphere"));
SeparationSphere->AttachTo(RootComponent);
SeparationSphere->SetSphereRadius(200.0f);
// create a neighbour volume used to detect surrounding neighbours
NeighbourSphere = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(this, TEXT("NeighbourSphere"));
NeighbourSphere->AttachTo(RootComponent);
NeighbourSphere->SetSphereRadius(600.0f);
}
/** Updates the pawn */
void ABoidPawn::Update()
{
}
/** Checks if the pawn is overlapping with any other boid_pawn */
bool ABoidPawn::IsOverlapping()
{
return true;
}
Can anyone see what i’m doing wrong! I’m taring my hair out. My full error message is as follows:
error c2248: ‘ABoidPawn::ABoidPawn’ : cannot access private member delcared in class ‘ABoidPawn’
Many thanks in advance. ![]()