Help with Spawning Pawns and Possesing them in a Listen Server

Hi, I’m making a system where players who get loged in the level, would have a pawn spawned and possessed. I’m using a custom pawn, because the movement of the Character didn’t fit my necessities. My problem is when possesing the pawns, the player who acts as listen server works fine, but the client PlayerController won’t posses the pawn. This is on the GameMode:

I have already checked that indeed both players are logged in, and assigned a PlayerController.
Thanks in advance.

I’m not sure how you tell that the client pawn isn’t being possessed. The way to check that is the case, is to listen to Possessed event inside pawn BP, which should be firing fine, because that is simply how you spawn and possess a pawn.

The easiest solution is to add some player starts into the level and set your default pawn class in the game mode as your custom pawn and also its respective player controller and you shouldn’t have to handle any spawning actors in the game mode unless you need further control of when and where they are spawned…

I have checked that already, still I don’t know why it refuses to posses

I was trying to not use player start. If it worked, I would use player start to spawn the players and then teleport them where I want. Either way, now it looks like it is getting possessed only on serverside

There is nothing as “I don’t know”, not in your case at least. You can breakpoint AController::Possess() function and see what’s going on there.

Try my method.
I don’t know if this works for you but it works for me.



1 Like

I ran into this problem as well. The issue is comes in with the Enhanced Input setup being called at BeginPlay on the character, which is before it’s possessed so there’s no player controller to reference. Remove the BeginPlay event and replace it with a custom event. Then after you call the possess function in your player controller, call this new custom event from there and you should be good to go.

2 Likes

Guys, your replies helped me solve a problem that I tried to fix for 2 weeks. Thank you!