I’m having issues trying to get my camera shake to work, when I make a brand new CameraShakeBase class and start trying to add functionality in the cpp file I get an error under my function about having no “default constructor”. Idk how to fix this if anyone has any idea on how to that would be great.
#pragma once
#include "CoreMinimal.h"
#include "Camera/CameraShakeBase.h"
#include "Pistol_Recoil_Shake.generated.h"
/**
*
*/
UCLASS()
class CUBE_RETRO_API UPistol_Recoil_Shake : public UCameraShakeBase
{
GENERATED_BODY()
public:
UPistol_Recoil_Shake();
};
When you’re extending UCameraShakeBase , you should use the FObjectInitializer as a parameter for your class’s constructor to correctly initialize the base class.
Your header would be: UPistol_Recoil_Shake(const FObjectInitializer& ObjectInitializer);
and your CPP would be:
UPistol_Recoil_Shake::UPistol_Recoil_Shake(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { // Code here }
Hey I ended up realizing that later but then I ran into another problem with more errors, but I ended up realizing that I needed ULegacyCameraShake not UCameraShakeBase. Thanks for the help tho