public:

UStaticMeshComponent* MainMesh;


UPROPERTY(EditAnywhere, Category = "MyCategory")

TSubclassOf<AUnit> UnitForCreate;


ConstructorHelpers::FObjectFinder<UStaticMesh>MainMeshFinder(TEXT("/Engine/VREditor/BasicMeshes/SM_Ball_01"));

MainMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MainMesh"));

MainMesh->SetupAttachment(RootComponent);

MainMesh->SetStaticMesh(MainMeshFinder.Object);



FVector SpawnLocation = GetActorLocation() + FVector(1.0f, 0.f, 0.f) *100.0f;


GetWorld()->SpawnActor<AUnit>(UnitForCreate, SpawnLocation, FRotator::ZeroRotator);