AActor* NewActor = World->SpawnActor<AActor>(AActor::StaticClass(), FTransform(Location + FVector(0.0f, 0.0f, 1000.0f)));
if (!NewActor) return false;
UStaticMeshComponent* MeshComponent = NewObject<UStaticMeshComponent>(NewActor);
if (!MeshComponent) return false;
//
MeshComponent->SetStaticMesh(ResourceNodeInfo.Mesh);
MeshComponent->SetMaterial(0, ResourceNodeInfo.Material);
MeshComponent->SetMobility(EComponentMobility::Movable);
MeshComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
MeshComponent->SetCollisionResponseToAllChannels(ECR_Block); // ?
MeshComponent->SetMassOverrideInKg(NAME_None, 100.0f); // ?
MeshComponent->SetEnableGravity(true);
MeshComponent->RegisterComponent();
NewActor->AddInstanceComponent(MeshComponent);
NewActor->SetRootComponent(MeshComponent);
MeshComponent->SetWorldLocation(Location);
MeshComponent->SetSimulatePhysics(true);
MeshComponent->AddImpulse(FVector(0.0f, 0.0f, -100.0f)); // ?
AActor* NewActor = World->SpawnActor<AActor>(AActor::StaticClass(), FTransform(Location + FVector(0.0f, 0.0f, 1000.0f)));
if (!NewActor) return false;
UStaticMeshComponent* MeshComponent = NewObject<UStaticMeshComponent>(NewActor);
if (!MeshComponent) return false;
//
MeshComponent->SetStaticMesh(ResourceNodeInfo.Mesh);
MeshComponent->SetMaterial(0, ResourceNodeInfo.Material);
MeshComponent->SetMobility(EComponentMobility::Movable);
MeshComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
MeshComponent->SetCollisionResponseToAllChannels(ECR_Block); // ?
MeshComponent->SetMassOverrideInKg(NAME_None, 100.0f); // ?
MeshComponent->SetEnableGravity(true);
MeshComponent->RegisterComponent();
NewActor->AddInstanceComponent(MeshComponent);
NewActor->SetRootComponent(MeshComponent);
MeshComponent->SetWorldLocation(Location);
MeshComponent->SetSimulatePhysics(true);
MeshComponent->AddImpulse(FVector(0.0f, 0.0f, -100.0f)); // ?