So I have a question first off I am not entirely new to c++ as I took one year of video game development and design in college but dropped out before we reached the UE4 part. Currently I am following a tutorial in the book mastering gaming for UE4 however I have been stuck on a part and in all honesty I think its just me overlooking something simple I keep getting the error Pointer to incomplete class is not allowed. Below is the code I have so far. Any help will be appreciated as Its been a while since I’ve done any c++ code I also apologize if I formatted this question wrong as this is my first post
// Fill out your copyright notice in the Description page of Project Settings.
#include "StealthCharacter.h"
void AStealthCharacter::SetupPlayerInputComponent(UInputComponent * PlayerInputComponent)
{
// Binds the jump events //
PlayerInputComponent-> BindAction ("Stealth", IE_Pressed, this, &AStealthCharacter::Stealth);
PlayerInputComponent-> BindAction ("Stealth", IE_Released, this, &AStealthCharacter::UnStealth);
Super::SetupPlayerInputComponent(PlayerInputComponent);
}
void AStealthCharacter::AddControllerPitchInput(float Val)
{
const float fscale = bIsStealthed ? StealthPitchYawScale : 1.0f;
Super::AddControllerPitchInput(Val*fscale);
}
void AStealthCharacter::AddControllerYawInput(float Val)
{
const float fscale = bIsStealthed ? StealthPitchYawScale : 1.0f;
Super::AddControllerYawInput(Val*fscale);
}
void AStealthCharacter::Stealth()
{
bIsStealthed = true;
Super::Crouch();
}
void AStealthCharacter::UnStealth()
{
bIsStealthed = false;
Super::UnCrouch();
}
So this is StealthCharacter.cpp the error am getting is in lines 9 and 10 under bind jump events comment
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "MasteringCharacter.h"
#include "StealthCharacter.generated.h"
/**
*
*/
UCLASS()
class MASTERING_API AStealthCharacter : public AMasteringCharacter
{
GENERATED_BODY()
public: // modifer to turn out and pitch rate when we are in stealth//
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
float StealthPitchYawScale = 0.5f;
public:
virtual void SetupPlayerInputComponent(UInputComponent * PlayerInputComponent) override;
virtual void AddControllerPitchInput(float Val) override;
virtual void AddControllerYawInput(float Val) override;
void Stealth();
void UnStealth();
protected:
bool bIsStealthed = false;
};
this here is StealthCharacter.h