in this header file I have created a Variable HealthtoAdd
pragma once
#include "CoreMinimal.h"
#include "Interactable_Master.h"
#include "HealthStation_Master.generated.h"
UCLASS()
class ZPROJECT_API AHealthStation_Master : public AInteractable_Master
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float HealthtoAdd = 100.0f;
};
in this cpp file I need to call this variable
#include "HealthStation_Master.h"
bool AInteractable_Master::InteractWith_Implementation(AActor* ActorInteracting)
{
if(ActorInteracting->Implements<UBPI_CharacterInfo>())
{
IBPI_CharacterInfo::Execute_AddHealth(ActorInteracting, HealthtoAdd);
}
return true;
}
but when I compile it says âerror C2065: âHealthtoAddâ: undeclared identifierâ
why does it has this error? Have I not declared it correcty in the header file ? The HealthStation_Master derived from the Interact_Master Class
Im completely new to c++ so I dont know if I have shared enough info to have an answer. I can provide more info if needed.
Thanks