Hello,
First I’m very new (just coming back from another engine)
I’m trying to use a native header file to store variables.
I have managed to reparent the blueprint to this c++ header.
Everything seems all on the up and up with the code.
However the blueprint is not letting me use the variable.
Also My copy of Visual studio 2019 wasn’t auto completing any unreal keywords, except Uproperty itself.
I would greatly appreciate any help!
Thanks!
–Joshua
************************************************Header file *********************************************
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include “CoreMinimal.h”
#include “GameFramework/Character.h”
#include “CharacterData.generated.h”
UCLASS()
class BALLROLLER_API ACharacterData : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character’s properties
ACharacterData();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
UPROPERTY(Editanywhere)
int gamescore;
};
**********************************************CPP file *****************************************************************
// Fill out your copyright notice in the Description page of Project Settings.
#include “CharacterData.h”
// Sets default values
ACharacterData::ACharacterData()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don’t need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void ACharacterData::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void ACharacterData::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void ACharacterData::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}