
void AItem::BeginPlay()
{
Super::BeginPlay();
FVector NewLocation(300.0f, 200.0f, 100.0f);
FRotator NewRotation(0.0f, 90.0f, 0.0f);
FVector NewScale(1.0f);
FTransform NewTransForm(NewRotation, NewLocation, NewScale); // 초기 위치
SetActorTransform(NewTransForm);
Times = 0.0f; //시간 측정 변수
DefaultPos = this->GetActorLocation(); // 기존위치 저장
AddScale = 2.0f; // 초당 스케일 변화값
}
void AItem::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
Times += DeltaTime; // 시간측정
if (Times > 2.0f) //2초
{
flag = !flag;
Times = 0.0f;
}
if (flag)//2초마다 스케일 조정
{
SetActorScale3D(this->GetActorScale3D() + FVector(AddScale * DeltaTime));
}
else
{
SetActorScale3D(this->GetActorScale3D() +FVector(-AddScale * DeltaTime));
}
if (!FMath::IsNearlyZero(RotationSpeedYaw)) //회전
{
AddActorLocalRotation(FRotator(0.0f, RotationSpeedYaw * DeltaTime, 0.0f));
}
if (_Distance > 100.0f)// 사이값 100 이상이면 반대로
{
SpeedZ = SpeedZ*-1;
}
AddActorWorldOffset(FVector(0.0f, 0.0f, SpeedZ * DeltaTime));
_Distance = FVector::Distance(DefaultPos, this->GetActorLocation()); //거리 계산
}

원인 : 언리얼 에디터를 킨채로 비주얼 스튜디오 빌드 시도
해결 : 끄고 빌드 하자
디버그 모드에서 뷰포트 에서 액터를 움직이면 발생했음
