I’m trying to set up a struct to complete the “Game-Controlled Cameras” tutorial. I’m looking to port a project from Unity to Unreal Engine.
I tried setting up a struct in the header, but got an error saying “‘struct’ is not allowed here”.
Here’s the code:
#pragma once
#include "GameFramework/Actor.h"
#include "CameraDirector.generated.h"
UCLASS()
class QUICKSTART_API ACameraDirector : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
ACameraDirector();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
UPROPERTY(EditAnywhere)
TArray<AActor*> CameraArray;
USTRUCT()
struct FCamera
{
GENERATED_BODY()
UPROPERTY()
AActor* NextCamera;
UPROPERTY()
float BlendTime;
FCamera()
{
NextCamera = nullptr;
BlendTime = 0;
}
};
float TimeToNextCameraChange;
int SelectedCamera;
};