Hello all, I have just got started with C++ and UE4, following the tutorials that Epic have put on their YouTube channel, but I keep getting this error.
Error 1 error : In CodedThirdPersonTestGameMode: Unrecognized type 'ECodedThirdPersonTestPlayState' C:\Users\\Documents\Unreal Projects\CodedThirdPersonTest\Source\CodedThirdPersonTest\Public\CodedThirdPersonTestGameMode.h 32 1 CodedThirdPersonTest
This is the tutorial I am following: Introduction to UE4 Programming - 16 - Setting the Rules in the GameMode
Here is my code:
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "GameFramework/GameMode.h"
#include "Pickup.h"
#include "CodedThirdPersonTestGameMode.generated.h"
// enum to store the current state of gameplay
/*UENUM(BlueprintType)
I get a different error when this line is in, regarding missing a '{' in 'Enum'
*/
enum class ECodedThirdPersonTestPlayState : uint8
{
EPlaying,
EGameOver,
EUnknown
};
UCLASS(minimalapi)
class ACodedThirdPersonTestGameMode : public AGameMode
{
GENERATED_UCLASS_BODY()
virtual void Tick(float DeltaSeconds) override;
/** The rate of power decay*/
UPROPERTY(EditAnywhere, BluePrintReadWrite, Category = Power)
float DecayRate;
/** Gets the current state of the game*/
UFUNCTION(BlueprintCallable, Category = Power)
ECodedThirdPersonTestPlayState GetCurrentGameState() const;
/** Sets the current state of the game*/
UFUNCTION(BlueprintCallable, Category = Power)
void SetCurrentState(ECodedThirdPersonTestPlayState NewState);
private:
ECodedThirdPersonTestPlayState CurrentGameState;
void HandleNewState(ECodedThirdPersonTestPlayState NewState);
};
FORCEINLINE ECodedThirdPersonTestPlayState ACodedThirdPersonTestGameMode::GetCurrentGameState() const
{
return CurrentGameState;
}
Can anyone please tell me what the problem is? My thanks.