๋ณธ๋ฌธ์œผ๋กœ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90

 

 

์ƒˆ C++ ํด๋ž˜์Šค๋ฅผ ๋งŒ๋“ค์–ด์„œ ๋นŒ๋“œํ–ˆ์„ ๋ฟ์ธ๋ฐ...

 

์–ธ๋ฆฌ์–ผ ์—”์ง„ 5.1 ๊ณต๋ถ€๋ฅผ ํ•˜๊ธฐ ์œ„ํ•ด, ์ƒˆ C++ ํด๋ž˜์Šค๋ฅผ ์ƒ์„ฑํ•ด์„œ ์‹ค์Šตํ•ด๋ณด๊ณ  ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. Visual Studio 2022์—์„œ ์ฝ”๋“œ๋ฅผ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž‘์„ฑํ•˜๊ณ , Ctrl + Shift + B๋ฅผ ๋ˆŒ๋Ÿฌ ๋นŒ๋“œ๋ฅผ ํ–ˆ๋Š”๋ฐ ์˜ค๋ฅ˜๊ฐ€ ๋œจ๋”๊ตฐ์š”.

// ํ—ค๋”ํŒŒ์ผ
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "MyActor.generated.h"

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

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

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

private:
	UPROPERTY()
	UStaticMeshComponent* Mesh;    // ์–ธ๋ฆฌ์–ผ ์—”์ง„ ๋„ค์ด๋ฐ ์ปจ๋ฒค์…˜์€ ์ฒซ ์•ž๊ธ€์ž๊ฐ€ ๋Œ€๋ฌธ์ž
};
// cpp ํŒŒ์ผ
// Fill out your copyright notice in the Description page of Project Settings.


#include "MyActor.h"

// Sets default values
AMyActor::AMyActor()
{
 	// Set this actor to call Tick() every frame.
    // You can turn this off to improve performance if you don't need it.
	// bCanEverTick์„ ์ผœ ๋†“์œผ๋ฉด, ๋งค ํ”„๋ ˆ์ž„๋งˆ๋‹ค Tick() ํ•จ์ˆ˜๊ฐ€ ํ˜ธ์ถœ๋œ๋‹ค.
	// ๊ทธ๋Ÿด ํ•„์š”๊ฐ€ ์—†์„ ๊ฒฝ์šฐ์—๋Š” ์„ฑ๋Šฅ์ƒ ์œ ๋ฆฌํ•˜๊ฒŒ ๊บผ๋‘๋„๋ก ํ•˜์ž.
	PrimaryActorTick.bCanEverTick = true;

	// ์–ธ๋ฆฌ์–ผ ์˜ค๋ธŒ์ ํŠธ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํ•จ์ˆ˜๋กœ ์˜ค๋ธŒ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.
	// TEXT()๊ฐ’์€ ํ•ด๋‹น ์˜ค๋ธŒ์ ํŠธ๋ฅผ ๊ตฌ๋ถ„ํ•  ํ•ด์‹œ๊ฐ’์„ ์ƒ์„ฑํ•  ์šฉ๋„๋กœ, ๊ฒน์น˜์ง€ ์•Š๊ฒŒ ์ž‘์„ฑํ•˜์—ฌ ์ค€๋‹ค.
	Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MESH"));
}

// Called when the game starts or when spawned
// ๊ฒŒ์ž„์ด ์‹œ์ž‘๋  ๋•Œ, ํ˜น์€ ์ƒ์„ฑ๋  ๋•Œ ํ˜ธ์ถœ๋ฉ๋‹ˆ๋‹ค.
void AMyActor::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame : ๋งค ํ”„๋ ˆ์ž„๋งˆ๋‹ค ํ˜ธ์ถœ๋˜๋Š” ํ•จ์ˆ˜์ž…๋‹ˆ๋‹ค.
void AMyActor::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

 

๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜ ๋ฉ”์„ธ์ง€๋“ค

 

 

ํ•ด๋‹น ์˜ค๋ฅ˜๋“ค๊ณผ ๊ด€๋ จํ•˜์—ฌ ๊ตฌ๊ธ€๋ง์„ ํ•ด๋ณด๋˜ ์ค‘, ๐Ÿ”—ํ•œ ๊ธ€์—์„œ ๋„์›€์„ ๋ฐ›๊ฒŒ ๋˜์—ˆ๋Š”๋ฐ ๊ฑฐ๊ธฐ์„œ ์•Œ๋ ค์ฃผ๋Š” ๊ถŒ์žฅ ๋ฐฉ์‹์œผ๋กœ๋Š”

Build + IntelliSence ๋Œ€์‹  Bulid Only๋ฅผ ์‚ฌ์šฉํ•˜๋ผ๊ณ  ํ•˜๋”๊ตฐ์š”. IntelliSence๊ฐ€ ์ž˜๋ชป๋œ ๊ฒฝ์šฐ๋„ ๊ฐ„๊ฐ„ํžˆ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ด๋ผ๋„ค์š”.

 

 

 

ํ•ด๋‹น ์„ค์ •์„ ํ•˜๊ณ  ๋‚˜๋‹ˆ, ํ•„์š”์—†๋Š” ๋ถ€๋ถ„๋“ค์€ ๋‹ค ์ง€์›Œ์ง€๊ณ  ์‹ค์ œ ์˜ค๋ฅ˜๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์•˜์Šต๋‹ˆ๋‹ค.

MSB3073	""C:\Program Files\Epic Games\UE_5.1\Engine\Build\BatchFiles\Build.bat"
CppPracticeEditor Win64 Development -Project=
"C:\Users\82104\Documents\Unreal Projects\Practice_UnrealEngine\CppPractice.uproject" 
-WaitMutex -FromMsBuild" ๋ช…๋ น์ด ์ข…๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค(์ฝ”๋“œ: 6).

CppPractice	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\
Microsoft\VC\v170\Microsoft.MakeFile.Targets

 

์•„๋ฌด๋ž˜๋„ ์–ธ๋ฆฌ์–ผ ์—”์ง„ ๋นŒ๋“œ์™€ ๊ด€๋ จ๋œ ๋ถ€๋ถ„์—์„œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” ๊ฒƒ ๊ฐ™์•„ ๋ณด์ž…๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋” ์ฐพ์•„๋ณด๋˜ ์ค‘, ๋ผ์ด๋ธŒ ์ฝ”๋”ฉ์˜ ๋นŒ๋“œ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ–ˆ๋”๋‹ˆ ๋นŒ๋“œ ๋ฌธ์ œ๊ฐ€ ํ•ด๊ฒฐ๋˜์–ด ๋ฒ„๋ ธ์Šต๋‹ˆ๋‹ค. IDE๋‚˜ ์–ธ๋ฆฌ์–ผ ์—”์ง„ ์—๋””ํ„ฐ ๋‘˜ ์ค‘ ํ•˜๋‚˜์—์„œ Ctrl + Alt + F11์„ ๋ˆ„๋ฅด๋ฉด ๋ผ์ด๋ธŒ ์ฝ”๋”ฉ ์ปดํŒŒ์ผ์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

 

๋ผ์ด๋ธŒ ์ฝ”๋”ฉ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ปดํŒŒ์ผ ์„ฑ๊ณตํ•œ ๋ชจ์Šต

 

์•„์ง ๊ณต๋ถ€๋ฅผ ํ•œ ์ง€ ์–ผ๋งˆ ์•ˆ ๋˜์–ด ๋‹ค๋Š” ๋ชจ๋ฅด์ง€๋งŒ, ๋„์›€์ด ๋ ๊นŒ ์‹ถ์–ด ๊ณต์œ ํ•˜๋ ค๊ณ  ์ด๋ ‡๊ฒŒ ์ž‘์„ฑํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

ํ˜น์‹œ ๋ผ์ด๋ธŒ ์ฝ”๋”ฉ ๊ธฐ๋Šฅ์ด ๋น„ํ™œ์„ฑํ™” ๋˜์–ด ์žˆ๋‹ค๋ฉด, ํŽธ์ง‘ - ์—๋””ํ„ฐ ๊ฐœ์ธ ์„ค์ • - ๋ผ์ด๋ธŒ ์ฝ”๋”ฉ ํƒญ์—์„œ ํ™œ์„ฑํ™” ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

 

728x90
๋ฐ˜์‘ํ˜•