C++에서 Vector반영하기
// Fill out your copyright notice in the Description page of Project Settings.
#include "Floater.h"
// Sets default values
AFloater::AFloater()
{
// 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;
StaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("CustomStaticMesh"));
}
// Called when the game starts or when spawned
void AFloater::BeginPlay()
{
Super::BeginPlay();
SetActorLocation(FVector(0.0f, 0.0f, 0.0f));
}
// Called every frame
void AFloater::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
모양이 보이기 위해서 Static Mesh를 IcoSphere로 지정해 줘야함을 잊지말자.
이렇게 변수로 선언해도 됨.
void AFloater::BeginPlay()
{
Super::BeginPlay();
FVector InitialLocation = FVector(0.0f, 0.0f, 0.0f);
SetActorLocation(InitialLocation);
}