틱에서 간단하게 사용된다.
if (!FMath::IsNearlyZero(MoveSpeed) && bMoving)
{
float Dist = FVector::Distance(StartLotation,GetActorLocation());
if (Dist >= MaxRange && !bReverseMove)
{
bReverseMove = !bReverseMove;
MoveVector *= -1;
}
else if (Dist < 1.f && bReverseMove)
{
bReverseMove = !bReverseMove;
MoveVector *= -1;
}
AddActorLocalOffset(MoveVector);
}
GC때문에 언리얼에서는 일반적으로는 사용하면 안되지만 그래도 있는 기능 못쓰기 어려우니까
어렵게 찾아서 방법을 적어둔다.
std::list<TWeakObjectPtr<ARotationFootrest>> ListRotationFootrest;
WeakPointer로 ref를 올려두지 않으면 제거할때 Destory()와 erase()를 사용해서 제거와 동시에 erase()해도 아무런 문제가 발생하지 않는다.