"Add movement Input" not working after respawn in multiplayer

Hi,
I have a weird behavior, and can’t explain what’s going on:
the “Add movement Input” node stop doing anything after a respawn, the problem only appear in multiplayer
I didn’t expect that problem so I took my a long time but I finally isolated the problem with this test:


The vector is always correct, and the print string always called, my character first run automatically (into a fire), die, respawn, then stop moving, while the print string keep displaying the vector…
this only occur if it’s running with the dedicated server.
I precise that rotation is working fine.

here is my respawn logic, running in game mode as far as I can tell it’s basically the same than in the wiki’s one (A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums):


For the moment directly called from my die function:

So what can be the reasons for the Add movement Input node for not adding movement input ? there is no documentation…
Another thing that I noticed, is that my controller is invalid when I try to use it from my character after it is respawned, here is a test I ran, the first string is always called after the respawn, It very likely to be related to my problem.


I have been thinking that maybe posses is not auto-replicated and that I should call it client side as well, I did try that but it doesn’t change anything, and the respawn wiki don’t do it.

Glad that people read the wiki. :smiley:
So, addMovementInput, here is the document:
APawn::AddMovementInput | Unreal Engine Documentation
I don’t know why but it seems that your node lacks a last argument(bForce), not like it should have any effect.

Now, for respawn, the reason why I use a player controller to issue respawn request is because there are copies of both pawn and controllers(to sync between client and server), and your pawn could be destroyed before you call actual respawn.
you could, however, use the ondestroyed event, to call your controller before you actually died, means in your die function send the event early on to your player controller and then deal with the rest settings for ragdoll.
This way your request for respawn is already in the event queue, and will follow through regardless if your pawn is gonna destroyed right now or much later.

see if you can address these first before moving on, I assuem after you make the respawn part solid the addMovementInput part should work automatically.(for anything inherit from Character and DefaultPawn)

Hi, thank you for answering me again :slight_smile:
Maybe my node lack an argument because I’m still running in 4.1.
I was going to answer that my respawn is actually working fine, because the error messages that were displayed in fact where coming from my ragdoll object, which lost is controller but it’s completely fine, once I added a “isDead == false” check to the beginning of my Event tick function, all the errors stopped showing. But then I tried that last test, and it fixed my problem:


This is dirty and only work for 1 player, I’ll try to move the respawn logic to the controller to see if it’s fixing it as you suggested, the only problem I have with your explanation, which make sense, is that the wiki (again) just like me call the spawn and the posses on the Game mode class.

so first it tells that the pawn movement component need a valid controller to work properly, secondly my code break the engine in a weird way, like it was half initialized because the isValid check is ok but it’s calling posses again that fix it…

Maybe all that stuff was fixed in the recent updates, but I have an hard time with this economics system of shipping a broken product for a low cost and then selling the fix patches.

Edit: just re-implemented the exact wiki’s respawn code on a new project, The wiki indeed show something that is not working. Posses need to be called on the client too, don’t know why my first test to do that didn’t worked.

the respawn wiki was written on 4.1, so if it works for me then, must work for you now.( I even did a dedicated server test, both window are client.)
actually every new version released, I did this test to make sure my respawn code is not broken, and from 4.1~4.4.2 it’s all work for me.
(my current respawn graph is still exactly the same as on wiki, even the graph node position is the same)

So make sure you didn’t skip something. :slight_smile:
(extra make sure you read the background knowledge part and all you bp follow that 3 rules.)
Btw, you can see I avoid using GetPlayerController for a reason, player index is a pita when you have multiple players.(involves more code and setups to make it right.)