I tried creating a CPP Subclass of Camera Manager that holds this Structure, placed at the top of the code:
USTRUCT(BlueprintType)
UCLASS()
Header (h.)
USTRUCT(BlueprintType)
// Make this Structure visible for Data Tables
struct FGD_DataRow_CndCameraMainParam : public FTableRowBase
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FText CameraName;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float FOV;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float MinFOV;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float MaxFOV;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float ArmLength;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float MinArmLength;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float MaxArmLength;
};
And I tried using the variables from it to clamp FOV and Arm Length Variable Values inside the source.
Source (CPP.)
// #FUNCTIONS (PUBLIC) START
void ACndPlayerCameraManager::BP_ChangeCamera()
{
float ClampedFOV = FMath::Clamp(FOV, MinFOV, MaxFOV); // Clamps FOV between Min and Max Variable Values
float ClampedArmLength = FMath::Clamp(ArmLength, MinArmLength, MaxArmLength); // Clamps Arm Length between Min and Max Variable Values
}
// #FUNCTIONS (PUBLIC) END
But I keep on getting the “identifier is undefined” error for FOV, MinFOV and MaxFOV, and I can’t get rid of these errors.
Plus the variable initializing values I’m struggling with inside source too:
// CONTSTRUCTOR - INITIALIZE MEMBER VARIABLES
ACndPlayerCameraManager::ACndPlayerCameraManager()
{
// Set default values for your custom parameters
ClampedFOV = (0,0f),
ClampedArmLength = (0,0f)
;
FGD_DataRow_CndCameraMainParam
CameraName(TEXT("Default")),
FOV(0,0f),
MinFOV(0,0f),
MaxFOV(0,0f),
ArmLength(0,0f),
MinArmLength(0,0f),
MaxArmLength(0,0f)
};
I keep getting either:
Undeclared identifier
User-Defined Literal not found
No instance of constructor
None of the 3 overloads could convert all the argument types
Can someone tell me what’s wrong? Or how should I properly set this up?
(Don’t tell “nothing’s wrong” as the Error List speaks for itself.)