I'm a beginner in c++, but why is it printed twice in Unreal?

I’m a beginner in c++, but why is it printed twice in Unreal?

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "HelloWorld.generated.h"

UCLASS()
class MYFRISTCPPPROJECT_API AHelloWorld : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AHelloWorld();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

};

//hello.h end

// Fill out your copyright notice in the Description page of Project Settings.


#include "HelloWorld.h"
#include "Engine.h"
// Sets default values
AHelloWorld::AHelloWorld()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;
	GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("Hello World"));
}

// Called when the game starts or when spawned
void AHelloWorld::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame
void AHelloWorld::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

//hellow.cpp end

GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT(“Hello World”));
를 void AHelloWrold::BeginPlay()
{
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT(“Hello World”));
}
에다가 넣으니까 한번만 나옴 자체해결

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.