I was following the Control Camera View in C++ tutorial.I think the two const vars defined in Tick() function could be defined in public section.So this is my code:
class HOWTO_AUTOCAMERA_API ACameraDirector : public AActor
{
GENERATED_BODY()
public:
…
float const timeBetweenCameraChanges;
float const smoothBlendTime;
};
ACameraDirector::ACameraDirector():timeBetweenCameraChanges(2.0f), smoothBlendTime(0.75f)
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
when I compiled I got errors:
HowTo_AutoCamera.generated.cpp(70): error C2789: ‘ACameraDirector::timeBetweenCameraChanges’: an object of const-qualified type must be initialized
CameraDirector.h(30): note: see declaration of ‘ACameraDirector::timeBetweenCameraChanges’