I’d like to know how to check if SpawnActorDeferred
will succeed when I’m using DontSpawnIfColliding
flag.
AItem* SpawnedItem = GetWorld()->SpawnActorDeferred(AItem, MyTransform, NULL, NULL, ESpawnActorCollisionHandlingMethod::DontSpawnIfColliding);
I call this code ^ and it always returns a pointer to my new object. Even if it collided with any other object.
I end up getting a log:
SpawnActor failed because of collision at the spawn location [X=300.000 Y=0.000 Z=-50.781] for [BP_RawIronOre_C]
after calling SpawnedItem->FinishSpawning(MyTransform);
I’d like to know how to check if the SpawnedItem
is not colliding so I don’t call FinishSpawning
and can delete the Actor. As there’s no point on spawning it anymore.
Thanks