Spawn Pawn fall through world

Hello All,

I’m working on getting a pawn to spawn into the level on player login, with the new player in control.

Now, I have 2 target points setup in my level, and this is where I want them to spawn. I have different colored character classes, based off a custom class I wrote. You’ll see my code to decide on the blueprint based on the current number of players and then the spawn code.

It seems this whole thing is broken. It seems to spawn a pawn at the target points, but its not visible until I give input. Second, it never picks the right blueprint, it always defaults to the blue, and lastly the actors fall through the world. Input on the characters seems to work fine.

Its a 2D side scroller, but I made sure my target points are set to the correct positions to prevent falling through.

(I used NumPlayers from gamemode, as I assumed this gets ++'d every time a player joins)

void ASideOpGameMode::PostLogin(APlayerController* NewPlayer)
{
	Super::PostLogin(NewPlayer);
	TArray<ATargetPoint*> SpawnPoints;
	UBlueprint* PlayerToSpawn;

	switch (NumPlayers)
	{
	case 0:
		PlayerToSpawn = BluePlayer;
		break;
	case 1:
		PlayerToSpawn = BeigePlayer;
		break;
	case 2:
		PlayerToSpawn = GreenPlayer;
		break;
	case 3:
		PlayerToSpawn = YellowPlayer;
		break;
	default:
		PlayerToSpawn = PinkPlayer;
		break;
	}

	for (TActorIterator<ATargetPoint> ActrItr(GetWorld()); ActrItr; ++ActrItr)
	{
		SpawnPoints.Add(*ActrItr); // Fill our spawn points
	}

	FActorSpawnParameters SpawnParams;
	SpawnParams.Instigator = nullptr;
	ASideOpCharacter* NewCharacter = GetWorld()->SpawnActor<ASideOpCharacter>(PlayerToSpawn->GetClass(),SpawnPoints[NumPlayers]->GetActorLocation(), SpawnPoints[NumPlayers]->GetActorRotation());
	NewPlayer->Possess(NewCharacter);

}

Any help is greatly appreciated.

Did you ever figure out this problem? I’m encountering the same thing, except when I attach the Pawn in one class it works, whereas it doesn’t work when I use the same code in another class.