Hello there,
I have a question about handling collision on multiple spawned objects (at the same location). I tried to search through the forum but couldn’t get much help(guess I wasn’t using the proper terms in search - I’m just a noob so please bear with me).
Issue:
I have about 14 target points in the scene and about 5 instances of an actor will be spawned at one target point during runtime. I achieve with this a small piece of code in my begin play function. The problem is when the 5 instances of the object is spawned at the target point they collide with each other and fly away. I want the objects to collide with each but I don’t want them flying across the scenes. What is the best way to achieve this ?
I also setup a new channel and assigned the collision property for that channel to overlap that stopped them from flying off but as the name suggests the objects stay overlapped against each other at the same point.
void ASpawnActor_ConchShell::BeginPlay()
{
FRotator Rotation(0.0f, 0.0f, 0.0f);
FActorSpawnParameters SpawnInfo;
Super::BeginPlay();
for (int i = 0; i < targetPoints.Num(); i++) {
for (int j = 0; j < 5; j++) {
GetWorld()->SpawnActor<ASpawnActor_ConchShell>(ConchShell_To_Spawn,targetPoints[i]->GetActorLocation(), Rotation,SpawnInfo);
}
}
}
Thanks a lot for taking time in helping me out