Why does this code crash the engine? I cant seem to figure out why
UWorld* const World = GetWorld();
if (World)
{
FActorSpawnParameters SpawnInfo;
SpawnInfo.Owner = this;
SpawnInfo.Instigator = this;
SpawnInfo.bNoCollisionFail = true;
World->SpawnActor<APickup>(WeaponClassToGive, GetMesh()->GetSocketLocation(TEXT("EyeSocket")), GetMesh()->GetSocketRotation(TEXT("EyeSocket")), SpawnInfo);
}