Well if you want more parts of my code( even though i think it would be useless) or the exact error i get let me know. Here is my whole header file and the implementation of the constructor in the cpp file. The const variables were renamed to x and y.
Header file
#pragma once
#include "GameFramework/Actor.h"
#include "CameraDirector.generated.h"
UCLASS()
class CAMS_API ACameraDirector : public AActor
{
GENERATED_BODY()
private:
struct Camera
{
AActor *CameraPtr;
float SmoothBlendTime;
float TimeBetweenCameraChanges;
Camera(AActor *ptr, float Sbt, float Tbcc)
{
CameraPtr = ptr;
SmoothBlendTime = Sbt;
TimeBetweenCameraChanges = Tbcc;
}
};
APlayerController* OurPlayerController;
TArray<Camera> Cams;
int camIndex;
int CamNum;
const float x;
const float y;
public:
// Sets default values for this actor's properties
ACameraDirector(const FObjectInitializer &ObjectInitializer);
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick(float DeltaSeconds) override;
float TimeToNextCameraChange;
};
CPP file with the constructor only
// Fill out your copyright notice in the Description page of Project Settings.
#include "Cams.h"
#include "CameraDirector.h"
#include "Kismet/GameplayStatics.h"
// Sets default values
ACameraDirector::ACameraDirector(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, x(0.75f)
, y(2.0f)
{
PrimaryActorTick.bCanEverTick = true;
}