본문 바로가기
Unreal Engine5/게임 만들기 - Obstacle Assault

Unreal Engine BeginPlay & Tick

by wanna_dev 2023. 7. 7.

모든 코드를 다 표시하진 않았지만 정리하면 다음과 같다. 

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


#include "MovingFlatform.h"

// Called when the game starts or when spawned
void AMovingFlatform::BeginPlay()
{
	Super::BeginPlay();
	// BeginPlay 다음에 게임플레이를 시작할 때 바로 실행될 코드
	// Unity 의 Start와 같은 역할
	// Header에서 선언했던 변수들을 접근하고 초기화 할 수 있다.

}

c++를 주언어로 사용하고 있고, OpenGL, Unity, Qt 도 학습한 적 있어서 그런지 Unreal 은 힐링같은 느낌이다.

 

 

다음과 같이 FVector 구조체를 사용할 수 있다. 

SetActorLocation(FVector(1,2,3));

액터의 transform 중 Location결정

Rotation, Size도 비슷한 방식일 것으로 추측하고 있다.

 

Tick함수는, 매게임 루프로 Unity 의 Update와 같은 역할을 하는 것 같다.