Header File
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include “CoreMinimal.h”
#include “GameFramework/Character.h”
#include “CPPtest.generated.h”
UCLASS(Blueprintable)
class ROLLABALLA2020_API ACPPtest : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character’s properties
ACPPtest();
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(BlueprintReadWrite, EditAnywhere) int32 score;
};
CPP File
// Fill out your copyright notice in the Description page of Project Settings.
#include “CPPtest.h”
// Sets default values
ACPPtest::ACPPtest()
{
// 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 ACPPtest::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void ACPPtest::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void ACPPtest::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}