Only the client player controller successfully possesses spawned characters

I have seen countless posts about how the client can’t get possession of a spawned character, however, I am having an issue where only the server cannot get possession. I followed this tutorial closely: https://youtu.be/H0JZnWdY0k8?si=Sc4mIsl32q7luUlp

This is where the possession should work properly:

I have set up a while loop to make it clear that the game should not start until possession is made for every character, but it would rather enter an infinite loop than work.

You can assume that all of the inputs are stable and valid, as I do IsVald? checks on them before and this loop would not run without them being valid.

When I run the game without the loop bit, both the server and client characters spawn, but only the client character is able to be moved, and only the client character outputs the debug message saying that it has a player controller. Interestingly, though, the server player controller prints out that it has a possessed pawn, even though the pawn doesn’t move and clearly isn’t possessed.

I’d be happy to provide more images/code. Any ideas?

whats calling this function?

id have the player controller spawn/possess its own pawn on begin play then notify the game mode or whatever when its ready. you dont want a while loop here, you always want it to be event driven

1 Like

Okay so I’ve solved it today. I tracked the issue down to my movement system not being set up properly, thus making it seem as though there is no Player Controller possessing the character.

My movement systems requires the Player Controller of the character to set up properly, so when the character was spawning, the nullptr PlayerController obviously wasn’t cutting it. So I made a function to retry setup of the movement system after the possess node fires, and that solved the issue.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.