Client canot spawn and posses a pawn

Hello, I created a game a few week ago and I decided to make this game multiplayer.
When I use in the blueprint “spawn actor from class”

and then “posses” the client’s screen stay black.

I use 2 different pawn with the same player controller

Hi, widgets only exist locally so they never replicate. Therefore things like RunOnServer or RunOnOwning client won’t do anything there. Further Possess needs to happen on the server, not on the client.

So that means that you need to call the RunOnServer event somewhere else. My advice would be that you choose one actor where you have all your RunOnServer events (e. g. the player controller). Then if you want to do something that the server should know about, then directly after the player input you call a RunOnServer event and do the rest on the server and then use replication to let the clients know about what they need to know. For player inputs through the widget, you could then directly call an event inside the player controller and from there directly call a RunOnServer event and then again let the server do the rest.

1 Like

I don’t know, I’ve never tried that. You can have player input in both pawns but the movement component might make you problems since if you just use something like AddMovement input, that will be rerouted through the player controller, but I guess I currently don’t see any usecase of controlling two pawns at the same time, for something like an RTS you would rather use AI controller and give them orders, can you explain a bit more what you need this for, so what you’re trying to achieve?

Thank you very much for your answer.
I’ve got another question: it is possible to control 2 different pawns (like a Falcon Millenium and a X-Wings) with the same player controller?
(sorry for my english, it’s not my native language)

it is not a character, it’s a pawn without any movement(character,flying pawn etc movement) I just use physics thrusters